Jump to content


This topic is now archived and is closed to further replies.


viewing raw data of posted files

Recommended Posts

Hi Gurus ,
I'm trying to illusrate to a friend of mine how mime raw data is posted , by using a simple HTML code for uploading several files and uploading the files to a PHP script.
the HTML form is pretty straight forward (I use ENCTYPE="multipart/form-data" , and MAX_FILE_SIZE variables) , however , at the the PHP level I did my best for viewing the raw data .
something like :

Content-Type: multipart/form-data;
Host: www.myserver.com
Content-Length: [The correct length]

Content-Disposition: form-data; name="whatever"

Content-Disposition: form-data; name="foo"

normal text, not binary

this is what I tried so far without any success :

1 . outputing the $http_post_data (after chaning php.ini as requested)
2 . outputing "php://input"
3.  outputing the $_POST array.

any idea how the I print the multipart-raw data request on the screen ??

Share this post

Link to post
Share on other sites
That's not going to work if that is what you are posting to the server. You need to open the communication and ask what the server allows, then you need to send the POST command targeted, after, when you get the response you send the post data. Also if doing this in PHP, you will not be able to read HTTP_RAW_POST [b]FILE[/b] data, only [b]POST[/b] //input streams are available, in order to read FILE streams you need to hack the core!

[quote]Quote: Rasmus!

multipart/form-data FILE requests will always be ignored no matter what always_populate... is set to, due to memory preservation reasons![/quote]

It's the same way even in PHP 6, only Perl and Python in scripting type languages, have full HTTP_RAW_POST support!


Share this post

Link to post
Share on other sites
Hmm .. so is there another way of showing how posted files (or other binary object) are parsed as mime type and raw data ?

Share this post

Link to post
Share on other sites


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.