> The only way to do this in PHP now is write a userland function that parses
> multipart form data, which is non-trivial.

In addition to PECL HTTP, you might try PECL Mailparse, which is also
going to be better-tested than anything written in userland.

I sympathize with your overall point: even without a new superglobal,
it would be cool to be able to reuse the same parser from $_POST.

Still, just to put this out there: receiving multiparts via PUT can be
part of a legit RESTful interface, but that doesn't mean that decoding
multiparts should be automatic. It shouldn't be surprising that it PHP
treats the entity as an opaque block of data by default, since it's
perfectly RESTful for _the MIME-encoded body_ to be the stored
resource.  Imagine an e-mail archive that PUTs to
/user/$username/sent/$messageid.  Decoding the MIME message on
resource create/update would be inappropriate in that case, a huge
waste of resources.  You might lazy-decode the resource only upon GET
/user/$username/sent/$messageid/part/1.  Within the same installation,
you might want to decode other PUTs upon upload, so having a simple
on/off for a new superglobal wouldn't work.

-- S.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to