Sending multipart/form-data request with PECL.
| From: | Jason Cipriani | Date: | Wed, 04 Mar 2009 18:33:17 +0000 |
| Subject: | Sending multipart/form-data request with PECL. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-289251@lists.php.net to get a copy of this message | ||
I am trying to submit a request to an HTTP server with
multipart/form-data encoded data. I'm using PECL's HttpRequest
(although I'm open to alternatives). I am using PHP5.
I noticed that if you call addPostFile to add a file, PECL will send
the file, and all other post parameters, with multipart/form-data
encoding, so I know PECL has the capability to do it. If you simply
call addPostFields but never call addPostFile, it uses standard post
encoding.
Is there a way to force PECL to use multipart/form-data encoding for
all post fields added with addPostFields, even when you are not
calling addPostFile to add a file?
If not, is there another good way to encode multipart data with PHP?
Thanks!
Jason