Re: cURL: multipart/form-data POST request with empty file part
| From: | Manuel Lemos | Date: | Sun, 06 May 2007 04:27:28 +0000 |
| Subject: | Re: cURL: multipart/form-data POST request with empty file part | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254479@lists.php.net to get a copy of this message | ||
Hello,
on 05/04/2007 09:44 AM Emmanuel Raulo-Kumagai said the following:
> Hello
>
> I'm writting a client in PHP for some CMS.
> I need to send an HTTP POST request with a multipart/form-data content.
> One of the parts is a file which must look like the request was issued
> after submitting a web form with a <input type="file" ...> field left
> empty, which is *NOT* the same as sending an empty file.
> This means the part should look like this in the request:
>
> -----------------------------8179530329826\r\n
> Content-Disposition: form-data; name="file"; filename=""\r\n
> Content-Type: application/octet-stream\r\n
> \r\n
> \r\n
> -----------------------------8179530329826\r\n
>
> Is there a way to do so with cURL ?
I use this HTTP client class that implicitly composes HTTP requests like
that when it is used to upload files emulating Web forms.
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/