Page 1 of 1

Form POST Upload + PowerPoint file = HTTP 413 Error

Posted: Mon Jan 26, 2004 4:08 pm
by bvillepc
I have encountered a very strange problem involving an HTML form POST with a File Upload field and a Microsoft PowerPoint file. This problem is a bit difficult to put into words, so I will first start by what I am trying to do, what I have already done, and what I have already discovered:

What I am trying to do:
I have a very simple HTML form with the action set to POST and the ENCTYPE set to multi-part/formdata. All that is on the form is a File Upload field and a Submit button. I was initially posting to a PHP script to take the uploaded file and save it on the server. Then I tried to upload a 1.4MB PowerPoint file through the form and the browser went straight to the "Page cannot be displayed" error. If I do a packet sniff while I try it, I can see the server is returning "HTTP Error 413 - Request entity too large."

What I have tried:
I checked the php.ini file's Max Upload size and Max Post size settings and all are set much higher than the size of the PowerPoint file, so it is not a size issue. I then tried posting to other PHP files with the same result. I even tried to post to a plain old text file and a html file with the same results. I also tried all of the above through Netscape. The only difference there was Netscape just popped up a little dialogue box saying, "Alert: Document contained no data." This only happens on PowerPoint files with more than 2 large jpeg images in it. Two jpeg images in a one-slide presentation seems to be the breaking point. Even if the PowerPoint file is compressed with ZIP, RAR, or ACE it still will not upload. The server I am trying to post to is running Apache/2.0.40 (Red Hat Linux). I have even tried posting to other servers with the same result.

Has anyone encountered this problem or heard about it? It has got to be the oddest thing I have ever seen.

Posted: Mon Jan 26, 2004 10:42 pm
by Pyrite
This really isn't supposed to be in Linux Forum, should be in PHP Code or something.

Posted: Tue Jan 27, 2004 8:55 am
by bvillepc
It was difficult determining where this this post should go, but it really just sounds like a general Apache bug, which resides on Linux, if you didn't know. 8O Thanks.

Posted: Tue Jan 27, 2004 1:31 pm
by hurdy gurdy
Silly question...
did you set the maxfilesize in a hidden input tag in your form?

could that be the problem?

Posted: Tue Jan 27, 2004 2:48 pm
by bvillepc
We figgured it out. My server guy found a hidden PHP setting in one of the conf files that was set too low. I was looking in the php.ini file for such a setting, but everything looked fine. He upped the value and everything works great now.

Posted: Tue Jan 27, 2004 2:49 pm
by Straterra
So..it wasn't a Linux error?

Posted: Tue Jan 27, 2004 9:01 pm
by Pyrite
Nope. Just like I said ...