Jump to content

viewing raw data of posted files


drorgo

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;
boundary=---------------------------7d12b732260086
Host: www.myserver.com
Content-Length: [The correct length]

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

123[NULL]456
-----------------------------7d12b732260086
Content-Disposition: form-data; name="foo"

normal text, not binary
-----------------------------7d12b732260086--
****END****



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 ??










Link to comment
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!

me!
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.