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