Re: Sending multipart/form-data request with PECL.
| From: | Shawn McKenzie | Date: | Wed, 04 Mar 2009 19:10:38 +0000 |
| Subject: | Re: Sending multipart/form-data request with PECL. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289258@lists.php.net to get a copy of this message | ||
Jason Cipriani wrote:
> 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
Try: setContentType()
--
Thanks!
-Shawn
http://www.spidean.com