docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
---
|
2023-01-02 20:51:48 +08:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2016-11-28 08:01:13 +08:00
|
|
|
Long: upload-file
|
|
|
|
Short: T
|
|
|
|
Arg: <file>
|
|
|
|
Help: Transfer local FILE to destination
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: important upload
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 4.0
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: append
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
See-also:
|
|
|
|
- get
|
|
|
|
- head
|
|
|
|
- request
|
|
|
|
- data
|
|
|
|
Example:
|
|
|
|
- -T file $URL
|
|
|
|
- -T "img[1-1000].png" ftp://ftp.example.com/
|
|
|
|
- --upload-file "{file1,file2}" $URL
|
2016-11-28 08:01:13 +08:00
|
|
|
---
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
|
|
|
|
# `--upload-file`
|
|
|
|
|
2023-09-08 20:32:29 +08:00
|
|
|
This transfers the specified local file to the remote URL.
|
|
|
|
|
|
|
|
If there is no file part in the specified URL, curl appends the local file
|
|
|
|
name to the end of the URL before the operation starts. You must use a
|
|
|
|
trailing slash (/) on the last directory to prove to curl that there is no
|
2024-02-27 17:35:28 +08:00
|
|
|
filename or curl thinks that your last directory name is the remote filename
|
2023-09-21 23:46:12 +08:00
|
|
|
to use.
|
|
|
|
|
2024-02-27 17:35:28 +08:00
|
|
|
When putting the local filename at the end of the URL, curl ignores what is on
|
|
|
|
the left side of any slash (/) or backslash (\) used in the filename and only
|
|
|
|
appends what is on the right side of the rightmost such character.
|
2016-11-28 08:01:13 +08:00
|
|
|
|
2024-02-27 17:35:28 +08:00
|
|
|
Use the filename `-` (a single dash) to use stdin instead of a given file.
|
|
|
|
Alternately, the filename `.` (a single period) may be specified instead of
|
2024-02-07 01:07:07 +08:00
|
|
|
`-` to use stdin in non-blocking mode to allow reading server output while
|
2021-08-31 22:37:14 +08:00
|
|
|
stdin is being uploaded.
|
2016-11-28 08:01:13 +08:00
|
|
|
|
2024-02-27 17:35:28 +08:00
|
|
|
If this option is used with an HTTP(S) URL, the PUT method is used.
|
2023-09-21 23:46:12 +08:00
|
|
|
|
2016-11-28 08:01:13 +08:00
|
|
|
You can specify one --upload-file for each URL on the command line. Each
|
|
|
|
--upload-file + URL pair specifies what to upload and to where. curl also
|
2024-02-07 01:07:07 +08:00
|
|
|
supports globbing of the --upload-file argument, meaning that you can upload
|
2016-11-28 08:01:13 +08:00
|
|
|
multiple files to a single URL by using the same URL globbing style supported
|
2021-08-31 22:37:14 +08:00
|
|
|
in the URL.
|
2016-11-28 08:01:13 +08:00
|
|
|
|
|
|
|
When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
|
|
|
|
formatted. It has to feature the necessary set of headers and mail body
|
2023-09-08 20:32:29 +08:00
|
|
|
formatted correctly by the user as curl does not transcode nor encode it
|
2016-11-28 08:01:13 +08:00
|
|
|
further in any way.
|