4 Help: Specify HTTP multipart POST data
6 Mutexed: data head upload
8 This lets curl emulate a filled-in form in which a user has pressed the submit
9 button. This causes curl to POST data using the Content-Type
10 multipart/form-data according to RFC 2388. This enables uploading of binary
11 files etc. To force the 'content' part to be a file, prefix the file name with
12 an @ sign. To just get the content part from a file, prefix the file name with
13 the symbol <. The difference between @ and < is then that @ makes a file get
14 attached in the post as a file upload, while the < makes a text field and just
15 get the contents for that text field from a file.
17 Example: to send an image to a server, where \&'profile' is the name of the
18 form-field to which portrait.jpg will be the input:
20 curl -F profile=@portrait.jpg https://example.com/upload.cgi
22 To read content from stdin instead of a file, use - as the filename. This goes
23 for both @ and < constructs. Unfortunately it does not support reading the
24 file from a named pipe or similar, as it needs the full size before the
27 You can also tell curl what Content-Type to use by using 'type=', in a manner
30 curl -F "web=@index.html;type=text/html" example.com
34 curl -F "name=daniel;type=text/foo" example.com
36 You can also explicitly change the name field of a file upload part by setting
39 curl -F "file=@localfile;filename=nameinpost" example.com
41 If filename/path contains ',' or ';', it must be quoted by double-quotes like:
43 curl -F "file=@\\"localfile\\";filename=\\"nameinpost\\"" example.com
47 curl -F 'file=@"localfile";filename="nameinpost"' example.com
49 Note that if a filename/path is quoted by double-quotes, any double-quote
50 or backslash within the filename must be escaped by backslash.
52 See further examples and details in the MANUAL.
54 This option can be used multiple times.