0

I have a HTML form with fields such as name, address, notes, etc. I also have a field to upload a PDF. The uploaded PDF get's stored on the file system.

How can I accomplish this if possibly the PDF files are larger than 2 MBs? Also, for some reason, the uploading of the PDF (< 2 MBs) works fine in Chrome, but not in IE. In IE, the upload doesn't even begin, but in Chrome, it completes fine.

Form header looks like:

method='post' ENCTYPE='multipart/formdata'

edit: the ini setting didn't help

The HTML

<input type='text' name='user' />
<input type='file' name='userfile' />

1 Answer 1

2

Try adding this to the top of your script:

ini_set('upload_max_filesize', '5M');

If that doesn't work, you can try changing that setting in php.ini

If none of this is applicable to your problem, include more of your code.

Also, change:

multipart/formdata

to:

multipart/form-data

If the problem persists, inspect the $_FILES array (print_r($_FILES))

Sign up to request clarification or add additional context in comments.

2 Comments

What happened when you tried to modify upload_max_filesize? I also added to my answer.
Don't forget the webserver's own POST limits (ie: Apache's 'LimitRequestBody'). PHP may have been set wide open for upload limits, but Apache/IIS/whatever could still be killing the transfer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.