RE: cURL: multipart/form-data POST request with empty file part

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emmanuel Raulo-Kumagai wrote:
> Sent: Friday, May 04, 2007 8:44 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  cURL: multipart/form-data POST request with 
> empty file part
> 
> 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 ?

Possibly.  Search the web for CURLOPT_CUSTOMREQUEST.

If cURL won't do what you need, you can always send a custom HTTP POST
request using fsockopen().  Again, search the web for examples.

-B

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux