Re: retrieve POST body?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Justin Frim wrote:
> Sorry burst your bubble, but your solution isn't a viable one in my case.
> php://input only works if the form is submitted using
> application/x-www-form-urlencoded.
> 
> Take your sample HTML code there and add enctype="multipart/form-data"
> to the <form> tag, and I'm pretty sure you'll find that php://input
> contains no data.  (Both PHP 5.2.1 running as a CGI on Windows and PHP
> 5.2.0 running as an Apache module on FreeBSD exhibit this behaviour.)
> 
> And before anyone asks, it *is* a requirement to accept
> multipart/form-data submissions because that's the only way you can
> properly implement a file upload on a web form.

Good news and bad news.  Rasmus reports on IRC:

[21:57] <Rasmus_> We never buffer the data in file upload mode
[21:57] <Rasmus_> it is streamed to disk, so no, you can't get it all in
a variable like that
[21:57] <Rasmus_> set a different content-type if you want to do that
[21:57] <Rasmus_> assuming you have control over the client
[21:58] <CelloG> can you do a file upload without multipart?
[21:59] <Rasmus_> Well, if you want to pick a POST apart yourself, sure
[21:59] <Rasmus_> set a mime type PHP doesn't understand and it will be
in http_raw_post_data and then you can do whatever you want with it

So the answer is "sort of."  You would have to parse the POST data
yourself, but it is technically a possibility.

Regards,
Greg
--
Experience the revolution, buy the PEAR Installer Manifesto
http://www.packtpub.com/book/PEAR-installer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux