curl's project page on


cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1333 POSTing multiple files produces an invalid Content-Type line

From: Daniel Stenberg <>
Date: Sat, 08 Feb 2014 16:21:51 +0000

Thanks, fixed in commit 9597f7dfbc95564b0c

** [bugs:#1333] POSTing multiple files produces an invalid Content-Type line**
**Status:** closed-fixed
**Created:** Thu Feb 06, 2014 09:17 AM UTC by Rob Davies
**Last Updated:** Thu Feb 06, 2014 10:31 PM UTC
**Owner:** Daniel Stenberg
curl --noproxy '*' -F"upload=@/tmp/t1,/tmp/t2" 'http://localhost:8080/test'
sends this:
POST /test HTTP/1.1
User-Agent: curl/7.35.0
Host: localhost:8080
Accept: */*
Content-Length: 545
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------ac8fa3db5d68f39f
Content-Disposition: form-data; name="upload"
Content-Type: multipart/mixed, boundary=------------------------0d5bb0db572656a0
Content-Disposition: attachment; filename="t1"
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="t2"
Content-Type: application/octet-stream
RFC2616 and RFC2045 state that the comma after "Content-Type: multipart/mixed" should be a semicolon.
The following patch fixes the issue:
diff -Naur curl-7.35.0/lib/formdata.c curl-7.35.0.fix/lib/formdata.c
--- curl-7.35.0/lib/formdata.c	2014-01-05 22:07:54.000000000 +0000
+++ curl-7.35.0.fix/lib/formdata.c	2014-02-05 09:28:22.443251990 +0000
@@ -1227,7 +1227,7 @@
       result = AddFormDataf(&form, &size,
-                            "\r\nContent-Type: multipart/mixed,"
+                            "\r\nContent-Type: multipart/mixed;"
                             " boundary=%s\r\n",
Version info:
curl -V
curl 7.35.0 (x86_64-unknown-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1 zlib/ libidn/1.23 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 
Sent from because is subscribed to
To unsubscribe from further messages, a project admin can change settings at  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-02-08

These mail archives are generated by hypermail.

donate! Page updated December 29, 2013.
web site info

File upload with ASP.NET