drorgo Posted October 22, 2006 Share Posted October 22, 2006 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=---------------------------7d12b732260086Host: www.myserver.comContent-Length: [The correct length]-----------------------------7d12b732260086Content-Disposition: form-data; name="whatever"123[NULL]456-----------------------------7d12b732260086Content-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 ?? Quote Link to comment Share on other sites More sharing options...
printf Posted October 22, 2006 Share Posted October 22, 2006 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! Quote Link to comment Share on other sites More sharing options...
drorgo Posted October 22, 2006 Author Share Posted October 22, 2006 Hmm .. so is there another way of showing how posted files (or other binary object) are parsed as mime type and raw data ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.