PHP file won't upload large file

69 views Asked by At

I have a php file upload script that our company uses to upload files to an imaging server. Most of those files are PDFs, TIF, and sometimes image files. I am trying to upload a 16MB file using move_uploaded_file() and it give as error. The $_FILES['userfile']['error'] shows code 2. Which means that file size is too large for what the server allows. But my php.ini settings are as follows:

memory_limit = 768M
post_max_size = 150M
upload_max_filesize = 150M

So I don't understand how my file size is too big. I tried a 5MB file and it worked just fine. What am I missing here?

I am running Apache 2.4.55 and PHP 5.6.1 on a Windows Machine.

I tried increasing the post_max_size and upload_max_filesize..But that did not have an effect.

1

There are 1 answers

0
Samuel Brown On

Inside my HTML form I changed

MAX_FILE_SIZE value="10000000" 

to

value="50000000" 

and it worked.

It's rare that we have users uploading documents that are beyond 50MB. Technically it could happen but in the last 10 years we haven't had that problem.