php file size limit
I trying to use PHP's file upload abilities, but when I try to upload certain file sizes (9MB for example) it's not going through. Smaller files goes fine.
Even when I set erro开发者_JAVA技巧r reporting to be on "E_ALL" and try and upload a bigger file. I don't see any error message.
I have tried setting these lines at the top of the PHP script that uploads the files but still no go:
ini_set('memory_limit', '96M');
ini_set('post_max_size', '96M');
ini_set('upload_max_filesize', '96M');
Take a look at the list of parameters for PHP and where you can set them. If I read that list correctly, post_max_size
and upload_max_filesize
can only be set in php.ini, not via ini_set.
Set those values in the appropriate php.ini (there are different ones for CLI and mod_php), or if you don't have access to the main php.ini create a php.ini in your folder.
To check if the settings work, create a phpinfo file and check the values.
try changing the php.ini file which is having certain properties.
you can change all the properties that u have mentioned in your php file into your ini file this worked for me. Try if it works for u as well
Try setting a MAX_FILE_SIZE
entry in the form.
<input type="hidden" name="MAX_FILE_SIZE" value="100663296" />
where the number is in bytes. Additionally, try changing the PHP settings in either php.ini
or a .htaccess
file in the same directory. The syntax for php settings in htaccess files are:
php_value name value
So you would say:
php_value memory_limit 96M
php_value post_max_size 96M
php_value upload_max_filesize 96M
Also, are you using your own server, or some online host. Some online hosts set a maximum file upload limit that you have to change in the Control Panel (depending on what interface the host uses), or they just plain don't let you change the max file size.
I don't see any error message.
that's because file uploads has it's own error messages. check $_FILES['filename']['error']
I have tried setting these lines
but you didn't check if it has any effect! run phpinfo()
to see actual values
精彩评论