Edit report at https://bugs.php.net/bug.php?id=41191&edit=1

 ID:                 41191
 Comment by:         peter dot e dot lind at gmail dot com
 Reported by:        jfrim at idirect dot com
 Summary:            Request for method to always retrieve POST body
 Status:             Open
 Type:               Feature/Change Request
 Package:            Feature/Change Request
 Operating System:   Win98
 PHP Version:        5.2.1
 Block user comment: N
 Private report:     N

 New Comment:

This is still quite a bother:
When you send a POST request of type multipart/form-data, the POST data is 
parsed 
no matter what and you have no chance to check the request body. If the POST 
request is invalid somehow (for instance, if the boundary is set wrong) the 
parser throws away the entire request body leaving you in the dark as to why 
there's no data coming through. Essentially, you are left with "The request is 
invalid somehow, but I have no clue as to why" - and if you cannot reproduce 
the 
error yourself, you're completely screwed.


Previous Comments:
------------------------------------------------------------------------
[2011-01-18 11:01:06] novikov at doroga dot tv

When the Java MIDP client sends wrong multipart/form-data message because of 
wrong Java implementation, I don't have a chance to fix the problem on the 
server side using PHP, just because I don't have any way to get a raw POST data.

------------------------------------------------------------------------
[2007-04-25 20:12:36] jfrim at idirect dot com

Description:
------------
Currently there exists no way in PHP to retrieve the POST body when a form is 
sent using multipart/form-data.  This is a problem for implementing protocols 
like HTTP digest authentication, which require the server to calculate a hash 
of the received POST body.

If making the POST body available on the php://input stream AT ALL TIMES 
regardless of the encoding type is impractical (possibly due to memory 
requirements when the POST body is very large), an alternative would be to 
stream the POST body, unaltered, directly to a temporary file.  (Similar to the 
way files uploaded with HTML forms are streamed to temporary files referenced 
in the $_FILES[] superglobal.)

This would allow authors to fully implement HTTP digest authentication in their 
scripts, and open up any other other possible situations where one might 
require an exact bit-accurate copy of the POST body.




------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=41191&edit=1

Reply via email to