php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64584 Content-length is correct, but data truncated in php://input
Submitted: 2013-04-04 17:12 UTC Modified: 2013-04-05 01:17 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: viraj dot kanwade at snstech dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.3.23 OS: Centos
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 - 3 = ?
Subscribe to this entry?

 
 [2013-04-04 17:12 UTC] viraj dot kanwade at snstech dot com
Description:
------------
We use PHP 5.3.14

Sometimes ajax post to a PHP page, results in $_SERVER content-length to be set 
correctly, but the $_POST does not have all data. I have also tested php://input 
to see if the data was received. But the data was truncated. This is NOT a file 
upload.

The data could be of 1000-5000 chars. But only 400-600 chars are received.

This is intermittent.

Could be similar to https://bugs.php.net/bug.php?id=22427

Expected result:
----------------
The post values submitted by ajax request should be available in $_POST.

Actual result:
--------------
The post value is truncated.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-05 01:17 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2013-04-05 01:17 UTC] rasmus@php.net
$_SERVER['Content-Length'] is set by the web server and tends to come directly 
from the Content-Length header the client sends. If the client aborts before 
sending all the data the web server is not going to adjust this value. This is 
quite normal. You can check the connection status to see if the client aborted 
mid-request on you. See http://php.net/manual/en/features.connection-handling.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 17:01:28 2024 UTC