I can upload small size files with no problem,
but fail when the size is more than 1M.
What's the matter?
I can upload small size files with no problem,
but fail when the size is more than 1M.
What's the matter?
Are you sure you have upload_max_filesize set correctly in php.ini?
You can call echo phpinfo() and then verify your upload_max_filesize and other php environment settings. Its very possible that your script is dying because one of the max limits is being exceeded.
Depending on your environment you can either use ini_set() to change the necessary values at run-time or you can simply edit your php.ini file to set the value permanently. Please note that not all php.ini settings can be changed at run time and if you do edit php.ini, you will need to restart Apache.
You probably need to configure the upload_max_filesize
directive, in your php.ini
file : PHP will not accept an upload of a file that is bigger than what this directive defines.
And note that you might also need to adjust post_max_size
-- which defines the total size of data that can be POSTed (And files upload are sent via POST).
You can also take a look at the Handling file uploads section of the manual, which can give you a couple of useful informations about files upload.
As said by others check your php.in for upload_max_filesize
and post_max_size
settings. If they are okay and if you are using a 3rd party script for uploading, make sure the script is not limiting the max file size by doing something like:
if( $_FILES["file"]["size"] > (1024 * 1024) ) // disallow uploads > 1MB
{
// max size exceeded.
}