blob: 6f01dbf35e0d71972328a391c0bc0112da4ee5e2 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001Long: upload-file
2Short: T
3Arg: <file>
4Help: Transfer local FILE to destination
5---
6This transfers the specified local file to the remote URL. If there is no file
7part in the specified URL, curl will append the local file name. NOTE that you
8must use a trailing / on the last directory to really prove to Curl that there
9is no file name or curl will think that your last directory name is the remote
10file name to use. That will most likely cause the upload operation to fail. If
11this is used on an HTTP(S) server, the PUT command will be used.
12
13Use the file name "-" (a single dash) to use stdin instead of a given file.
14Alternately, the file name "." (a single period) may be specified instead
15of "-" to use stdin in non-blocking mode to allow reading server output
16while stdin is being uploaded.
17
18You can specify one --upload-file for each URL on the command line. Each
19--upload-file + URL pair specifies what to upload and to where. curl also
20supports "globbing" of the --upload-file argument, meaning that you can upload
21multiple files to a single URL by using the same URL globbing style supported
22in the URL, like this:
23
24 curl --upload-file "{file1,file2}" http://www.example.com
25
26or even
27
28 curl -T "img[1-1000].png" ftp://ftp.example.com/upload/
29
30When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
31formatted. It has to feature the necessary set of headers and mail body
32formatted correctly by the user as curl will not transcode nor encode it
33further in any way.