cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to add filename field in multipart/form-data POST

From: Yu Gong <vgong_at_adobe.com>
Date: Wed, 28 Nov 2012 18:34:17 -0800

Hi guys,

I tried to POST data using the content-type multipart/form-data to a Web server while failed because of the lack of field "filename=xxx", which is required by the server. Could you please let me know how I can add it to my POST data? I didn't find the related information in cURL manual.

What I currently POST in cURL:

------------------------------e5ce793299d5
Content-Disposition: form-data; name="file"
Content-Type: application/x-xliff+xml

<File Content>
------------------------------e5ce793299d5

What I want my POST data to be:

------------------------------e5ce793299d5
Content-Disposition: form-data; name="file";filename=<filename>
Content-Type: application/x-xliff+xml

<File Content>
------------------------------e5ce793299d5

Thanks & Regards,
Yu

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-29