Jump to content

PHP Warning: Unknown: POST Content-Length of 0 bytes exceeds the limit of -xxxxxxxxxx bytes in Unknown on line 0


damion

Recommended Posts

Hope you can help explain this warning.  I have an upload script that chokes intermittently during uploads, but very rare when it does.  It's an annoyance more than anything else.

There are no helpful errors on the form when it does fail, but I happened to look at the error log on the server and found this repeated a few dozen times (always has the same limit value):

 

PHP Warning:  Unknown: POST Content-Length of 0 bytes exceeds the limit of -1051798902 bytes in Unknown on line 0

 

My php.ini file bumps up the memory, post and upload size, etc, and I can upload pretty huge files successfully, the biggest was over a half gigabyte once.  I know ftp is the best way to go for large files.  But this is reliable enough for my use and I'm just trying to understand the warning message. I can't find any results when I do a google search that has '0' as the content length, it's always a larger number.

 

Tnx

 

 

Link to comment
Share on other sites

normally, the Content-Length is the value that the browser sent in the request when it starts to submit the form data, even if that value is greater than the post_max_size setting. i'm guessing that you either found a bug in php or you are on a 32bit system, the post_max_size setting is greater than a 32bit signed integer (2,147,483,647), and the math that php is doing to check the Content-Length against that setting is failing and resulting the a zero being listed for the Content-Length. the fact that the limit is being reported as a negative number supports the 32bit signed integer limit possibility.

 

also, afaik, when the Content-Length is greater then the post_max_size setting, php tries (wishful thinking) to abort the upload. it may be that the browser/client you are using respects this, and then sends another post request with a Content-Length of zero.

 

what is your post_max_size setting (what exactly are you setting it to and what does a phpinfo() statement report it being) and are you doing this on a 32bit php installation?

Link to comment
Share on other sites

a post method form that has no name='....' attributes in the fields or has only empty name='' attributes in the fields will also send a CONTENT_LENGTH of zero. is there any chance that you are dynamically producing the form, either via php or javascript, or are using javascript to submit the form?

Edited by mac_gyver
Link to comment
Share on other sites

mac_gyver, thanks for your help. The server is a 64bit and phpinfo() shows what I have in my php.ini file for post_max_size.  It is 3072M.

 

But...the form does not have a name="", not even a blank value for it.

 

This is it:

<form id="form1" action="upload.php" method="post" enctype="multipart/form-data">

 

Unfortunatley, I won't be able to help with the answer of how the form is being produced.  I don't know.  But I do know there is PHP, js, and ajax there.  And some flash too for the uploader.

 

So several files can be uploaded at one time, the form has multiple file fields if it helps you to know.

 

 

Thanks again.

Link to comment
Share on other sites

The server is a 64bit

 

 

that may be, but is the php language engine 32 or 64 bit?

 

 

a post method form that has no name='....' attributes in the fields or has only empty name='' attributes in the fields will also send a CONTENT_LENGTH of zero. is there any chance that you are dynamically producing the form, either via php or javascript, or are using javascript to submit the form?

 

that statement concerns the form fields, not the <form tag.

 

 

But I do know there is PHP, js, and ajax there.  And some flash too for the uploader.

 

 

that sounds like it's one of the third-party flash based file unloaders. care to share which one in case someone has some specific knowledge about it and your symptom that could lead to a solution?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.