In php, the size of the uploaded file is determined. However, when the file is too large, the value of print_r ($ _ FILES); becomes null. sometimes you may encounter such a problem, when uploading small files
In php, the size of the uploaded file is determined. However, when the file is too large, the value of print_r ($ _ FILES); becomes null. sometimes you may encounter such a problem, when uploading small files, PHP can get them normally, but the file becomes blank when it exceeds 8 MB. this problem occurs when I am working on a project, at the beginning, I changed the maximum file Upload value to 20 MB. INI,
PHP code
- ; Maximum allowed size for uploaded files.
- Upload_max_filesize = 20 M
After restarting apache, files larger than 8 MB still cannot be uploaded and retrieved as null. I checked it online. when the original form was uploaded, the default maximum memory size was 8 MB. modify it, restart apache to solve the problem.
PHP code
- ; Maximum size of POST data that PHP will accept.
- Post_max_size = 20 M
Upload friends, pay attention to it!