Re: Sending multipart/form-data request with PECL.
| From: | Manuel Lemos | Date: | Wed, 04 Mar 2009 22:43:44 +0000 |
| Subject: | Re: Sending multipart/form-data request with PECL. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289291@lists.php.net to get a copy of this message | ||
Hello,
on 03/04/2009 03:33 PM Jason Cipriani said the following:
> 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?
I have no idea because I do not use PECL extensions.
I use this HTTP client class for emulating browser form submission. Take
a look at the test_http_post.php that has examples of how to upload
forms using POST requests:
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/