Page 1 of 1
error in upload large file
Posted: Sat Aug 07, 2010 5:06 am
by simran10101
if user is uploading a large file from our website ( form ) then a user who uploads larger file will get no error and still the form will be processed only without the file.[this code is work ok till 10MB] but more than 10mb it is not working. Can any body tell me the solution of this pbm.
Thanks in Adv
Re: error in upload large file
Posted: Sat Aug 07, 2010 5:09 am
by pbs
Check "upload_max_filesize" in PHP.INI file
Re: error in upload large file
Posted: Sat Aug 07, 2010 1:34 pm
by cpetercarter
As pbs has indicated, your php installation will have a limit to the size of file which it will upload. You can check what the limit is with the following:
Code: Select all
$echo "Maximum upload limit is " . ini_get('upload_max_filesize');
Often it is as low as 2Mb.
Annoyingly, you don't generally get an error message when an upload fails because a file is too large - the upload just fails silently.
What to do? You can of course change the setting in php.ini, but most users do not have access to the php.ini file, nor can they restart Apache (which is needed for the new setting to have effect). It is sometimes possible to increase the maximum size of an uploaded file in an .htaccess file:
But Apache is sometimes set up to reject attempts to rewrite php values in .htaccess files - worse, you get "Internal Server Errors" until you remove the offending line from the .htaccess file.
Which leaves you with :
using a perl/cgi script to upload large files, if your server admin allows this.
ftp - ftp servers can upload large files, but you will need to think carefully through the security implications of letting users access your site via ftp.