Uploading a file size greater than 50 mb.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mohanaturheart
Forum Newbie
Posts: 4
Joined: Tue Sep 25, 2007 1:40 am

Uploading a file size greater than 50 mb.

Post by mohanaturheart »

Uploading a File in PHP using Http (or) FTP.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

Yeah....and???
mohanaturheart
Forum Newbie
Posts: 4
Joined: Tue Sep 25, 2007 1:40 am

upload a file in php which size greater than 50 mb.

Post by mohanaturheart »

I want to know, How to Upload a file in php which size is greather than 50 mb.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

First of all you probably want to make sure you have a good enough banwidth to deal with larger file uploads.

Secondly you will need an upload script - take a look at this basic script: http://www.tizag.com/phpT/fileupload.php

The link i posted offers a very basic upload script and really requires additional precautionary configuration i.e. file type exclusions (only accept gif, jpg, png etc...) and typcial error trapping and whatever else you want to do.

Hope this helps.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Change your server's configuration where it deals with "post_max_size" and "upload_max_filesize" in your php.ini file (or use ini_set(), but that's only temporary).
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

Even if your server is configured to allow uploads up to 50 megs, who ever is uploading better have a nice connection also, because eventually the server might time out (Because of how long it will take).
mohanaturheart
Forum Newbie
Posts: 4
Joined: Tue Sep 25, 2007 1:40 am

Php file uploading

Post by mohanaturheart »

aceconcepts wrote:First of all you probably want to make sure you have a good enough banwidth to deal with larger file uploads.

Secondly you will need an upload script - take a look at this basic script: http://www.tizag.com/phpT/fileupload.php

The link i posted offers a very basic upload script and really requires additional precautionary configuration i.e. file type exclusions (only accept gif, jpg, png etc...) and typcial error trapping and whatever else you want to do.

Hope this helps.
Normally now i am uploading a file its size is less than 2 mb. Now I have to upload minimum 8 to maximum 20 mb. From your answer i am cleared that our clients are maximum using 256 mbps speed network connections only. I am visit the tizag.com upload script that is ok. But when size is greater than 2mb all of them said set the ini_set("upload_max_filesize","20M"), ini_set("post_max_size","20M"); but this are not working . Please help me.
[/quote]
mohanaturheart
Forum Newbie
Posts: 4
Joined: Tue Sep 25, 2007 1:40 am

Help in Uploading

Post by mohanaturheart »

I set the ini_set("upload_max_filesize","20M"), ini_set("post_max_size","20M"); but this are not working . Please help me.
mrkite
Forum Contributor
Posts: 104
Joined: Tue Sep 11, 2007 4:19 am

Post by mrkite »

you can't use ini_set, by the time your script runs the file has already been uploaded. You must modify php.ini
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

mrkite wrote:you can't use ini_set, by the time your script runs the file has already been uploaded. You must modify php.ini
OR in the .htaccess.

Code: Select all

php_value upload_max_filesize 20M
Post Reply