HTML Forms - File Browser - Form wont submit when including a large PDF (>30MB)

At the moment I have a very basic html form - it has 4 form fields (file-pickers) and a submit button.

If I submit the form with no files selected, it continues to the next page.
If I add a small (2MB) file into one of the file pickers and submit the form, it continues to the next page.
If I add a large (32MB) file into one of the file pickers and submit the form, it never leaves the page (the 'working' icon spins around in IE, but it never actually proceeds).

This problem appears to be relevant on the form page only (not the form processor) - I've changed the form action to a page that does not exist - and the outcome is the same in all 3 scenarios listed above,

Any ideas on how to fix this?

Thanks
BergstrAsked:
Who is Participating?
 
Ray PaseurCommented:
Excerpted comments form my teaching examples:

// MANUAL REFERENCE PAGES YOU MUST UNDERSTAND TO UPLOAD FILES
// http://php.net/manual/en/features.file-upload.php
// http://php.net/manual/en/features.file-upload.common-pitfalls.php
// http://php.net/manual/en/function.move-uploaded-file.php
// http://php.net/manual/en/reserved.variables.files.php

// MANUAL PAGES THAT ARE IMPORTANT IF YOU ARE DEALING WITH LARGE FILES
// http://php.net/manual/en/ini.core.php#ini.upload-max-filesize
// http://php.net/manual/en/ini.core.php#ini.post-max-size
// http://php.net/manual/en/info.configuration.php#ini.max-input-time

Open in new window

I would consider 32MB to be a large file.  Can you please post your HTML upload form?  I'd like to install it and try it myself.
0
 
BergstrAuthor Commented:
I've reduced the page down to 1 field and 1 submit button, and still experience the problem. The full page is below.

I don't think this is related to the PHP controls - at this point there is no php - when it gets through to the processor, php will come into play - but I already have other code working fine using similar style forms, and then having PHP validation and upload processes - The problem seems to start when you start uploading large files as it wont even submit the data, so we don't even get to the validation stage.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form method="post" action="TEST.PHP" enctype="multipart/form-data">
  <input type="file" name="NewCat" id="NewCat" />
  <br />
  <input name="Submit" type="submit" value="Submit" />
</form>
</body>
</html>

Open in new window


Thanks
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
BergstrAuthor Commented:
They were:

upload max filesize: 50M
post max size 8M
Max input time: 60

Just updated these to 50M / 50M / 240, restarted and I'm now retrying the upload... will let you know the outcome in a few minutes!

Thanks
0
 
Ray PaseurCommented:
Makes sense to increase the values.

You may also need something in the HTML form.  I've used something like this in my upload forms.

<input type="hidden" name="MAX_FILE_SIZE" value="$max_file_size" />

The variable is a decimal number, like maybe 50000000 (== 50,000,000)
0
 
BergstrAuthor Commented:
almost 10 mins later and IE is still showing the form field, and the loading icon is still spinning around.

Do I need to increase the Max_input_time to a higher figure?

As a note, I can upload that file from my PC to the server in less than 30 seconds using FTP, so I don't think its down to a slow connection or anything like that.

Thanks
0
 
Ray PaseurCommented:
Can you try it in Firefox or Chrome?  I don't usually recommend uploading a 50MB file via HTTP, but it might be interesting to see if another browser is capable.
0
 
Dan CraciunConnect With a Mentor IT ConsultantCommented:
I think you need to increase post_max_size to be at least 50M.

post_max_size integer
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.
From the manual here: http://www.php.net/manual/en/ini.core.php#ini.post-max-size

HTH,
Dan
0
 
Ray PaseurCommented:
Dan: Yeah, I think we're trying that now.  Also, 50M is not the same as 50,000,000 bytes, so setting the size to something exact may not be as good as setting the size to something that is obviously larger than the largest file size.

PHP is an old language, and these artificial restrictions don't make as much sense any more.
0
 
BergstrAuthor Commented:
I think by changing these settings, we've broken php!!

A quick google says that setting post_max_size to the same value as upload_max_filesize stops $_POST from working at all!

I'm now moving from the form page to the processor, but the processor is acting like it has no data.

Need to make some more config changes, get this problem solved and hopefully things will start working!
0
 
BergstrAuthor Commented:
Note: post_max_size must be set to a lower value than upload_max_filesize, or $_POST stops working completely.

They have now been changed to 60M & 50M - the script is now working for smaller files! Just tried running a 30MB file so we'll see how this goes. It appears to go through after around 10-15 mins.
0
 
BergstrAuthor Commented:
it works! a little bit slow (takes around 10~15 mins to upload 30mb), but it does upload the file!

Thanks very much for your help.
0
 
Ray PaseurCommented:
On my server, I have post_max_size=108M and upload_max_filesize=102M.  No problems of any sort.

But in any case, glad you've got it working and thanks for the points, ~Ray
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.