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