Form POST Upload + PowerPoint file = HTTP 413 Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bvillepc
Forum Newbie
Posts: 3
Joined: Mon Jan 26, 2004 4:08 pm
Location: Bartlesville, OK, USA

Form POST Upload + PowerPoint file = HTTP 413 Error

Post 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.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

This really isn't supposed to be in Linux Forum, should be in PHP Code or something.
bvillepc
Forum Newbie
Posts: 3
Joined: Mon Jan 26, 2004 4:08 pm
Location: Bartlesville, OK, USA

Post 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.
hurdy gurdy
Forum Commoner
Posts: 40
Joined: Mon Jun 09, 2003 8:19 pm

Post by hurdy gurdy »

Silly question...
did you set the maxfilesize in a hidden input tag in your form?

could that be the problem?
bvillepc
Forum Newbie
Posts: 3
Joined: Mon Jan 26, 2004 4:08 pm
Location: Bartlesville, OK, USA

Post 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.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

So..it wasn't a Linux error?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Nope. Just like I said ...
Post Reply