I am having a strange problem loading large files in PHP.
In php.ini max_execution_time set to 30, post_max_size set to 32M, upload_max_filesize set to 32M. When I tried to download a 40.2 MB file, it does not show any errors. The variable $_FILES is set to array(0) { } and $_FILES['userfile'] shows NULL .
If the file size is larger than the value specified in php.ini, it should return an error message
UPLOAD_ERR_INI_SIZE, value: 1; The downloaded file exceeds the upload_max_filesize directive in php.ini.
But it also does not show any errors (since $_FILES is an empty array). I do not know why this is happening.
When I modify php.ini and set post_max_size, it is set to 64M, upload_max_filesize set to 64M, then it works fine. So I decided to use the following code instead of modifying the php.ini file.
ini_set('upload_max_filesize', '64M'); ini_set('post_max_size', '64M'); ini_set('max_execution_time', 300);
I even tried increasing max_execution_time . However, I have the same problem. ini_set() does not work here.
php file-upload
Debiprasad
source share