Jump to content


Photo

viewing raw data of posted files


  • Please log in to reply
2 replies to this topic

#1 drorgo

drorgo
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 22 October 2006 - 04:40 PM

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












#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 22 October 2006 - 06:10 PM

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 FILE data, only POST //input streams are available, in order to read FILE streams you need to hack the core!

Quote: Rasmus!

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


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

me!

#3 drorgo

drorgo
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 22 October 2006 - 06:30 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users