Page 1 of 1
$HTTP_RAW_POST_DATA and enctype="multipart/form-data&qu
Posted: Thu Apr 13, 2006 2:54 pm
by tomprogers
Code: Select all
// php.ini
always_populate_raw_post_data = On
Given this form:
The passed data are available via $HTTP_RAW_POST_DATA. However, given
this form:
Code: Select all
<form method="post" enctype="multipart/form-data"> ... </form>
$HTTP_RAW_POST_DATA is
not populated. Why does this happen?
Posted: Thu Apr 13, 2006 7:36 pm
by Ambush Commander
This PHP bug from
this Google. Google is your friend.

Posted: Thu Apr 13, 2006 8:31 pm
by tomprogers
I already read this post, and it led me to believe that the problem was fixed 3 years ago. Also, I can't tell from the thread whether it was necessary to recompile PHP without that line of code. I can't just take the server down to test a fix I'm not 100% sure how to implement.
Posted: Thu Apr 13, 2006 8:36 pm
by Ambush Commander
Oh, no. The problem that was
fixed was that PHP was misinterpreting files uploads from the embedded device. They didn't turn off PHP's form upload preprocessing.
I interpreted your question as "Why" it was happening, the "Why" is because PHP automatically handles form uploads for you and thus doesn't populate the raw post data, and setting enctype="multipart/form-data" makes PHP recognize it as form data. There really shouldn't be any reason why you need to access the raw post data anyway.
Of course, you might need to access it.

But really can't help you until you tell us for what.
Posted: Thu Apr 13, 2006 9:53 pm
by timvw
In case someone is posting XML to your php script, there is a good reason to get access to the raw data

(But these days you get that from the 'php://input' 'file'.. Anyway in most cases $_FILES and $_POST are sufficient)
Posted: Thu Apr 13, 2006 9:55 pm
by Ambush Commander
Ah, but XML wouldn't bother with a webform, would it?