xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. |
| 2 | SPDX-License-Identifier: curl |
| 3 | Long: upload-file |
| 4 | Short: T |
| 5 | Arg: <file> |
| 6 | Help: Transfer local FILE to destination |
| 7 | Category: important upload |
| 8 | Example: -T file $URL |
| 9 | Example: -T "img[1-1000].png" ftp://ftp.example.com/ |
| 10 | Example: --upload-file "{file1,file2}" $URL |
| 11 | Added: 4.0 |
| 12 | See-also: get head |
| 13 | Multi: append |
| 14 | --- |
| 15 | This transfers the specified local file to the remote URL. If there is no file |
| 16 | part in the specified URL, curl will append the local file name. NOTE that you |
| 17 | must use a trailing / on the last directory to really prove to Curl that there |
| 18 | is no file name or curl will think that your last directory name is the remote |
| 19 | file name to use. That will most likely cause the upload operation to fail. If |
| 20 | this is used on an HTTP(S) server, the PUT command will be used. |
| 21 | |
| 22 | Use the file name "-" (a single dash) to use stdin instead of a given file. |
| 23 | Alternately, the file name "." (a single period) may be specified instead of |
| 24 | "-" to use stdin in non-blocking mode to allow reading server output while |
| 25 | stdin is being uploaded. |
| 26 | |
| 27 | You can specify one --upload-file for each URL on the command line. Each |
| 28 | --upload-file + URL pair specifies what to upload and to where. curl also |
| 29 | supports "globbing" of the --upload-file argument, meaning that you can upload |
| 30 | multiple files to a single URL by using the same URL globbing style supported |
| 31 | in the URL. |
| 32 | |
| 33 | When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322 |
| 34 | formatted. It has to feature the necessary set of headers and mail body |
| 35 | formatted correctly by the user as curl will not transcode nor encode it |
| 36 | further in any way. |