2
0

upload-file.d 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. c: Copyright (C) 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 request data
  13. Multi: append
  14. ---
  15. This transfers the specified local file to the remote URL.
  16. If there is no file part in the specified URL, curl appends the local file
  17. name to the end of the URL before the operation starts. You must use a
  18. trailing slash (/) on the last directory to prove to curl that there is no
  19. file name or curl thinks that your last directory name is the remote file name
  20. to use.
  21. When putting the local file name at the end of the URL, curl ignores what is
  22. on the left side of any slash (/) or backslash (\\) used in the file name and
  23. only appends what is on the right side of the rightmost such character.
  24. Use the file name "-" (a single dash) to use stdin instead of a given file.
  25. Alternately, the file name "." (a single period) may be specified instead of
  26. "-" to use stdin in non-blocking mode to allow reading server output while
  27. stdin is being uploaded.
  28. If this option is used with a HTTP(S) URL, the PUT method is used.
  29. You can specify one --upload-file for each URL on the command line. Each
  30. --upload-file + URL pair specifies what to upload and to where. curl also
  31. supports "globbing" of the --upload-file argument, meaning that you can upload
  32. multiple files to a single URL by using the same URL globbing style supported
  33. in the URL.
  34. When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
  35. formatted. It has to feature the necessary set of headers and mail body
  36. formatted correctly by the user as curl does not transcode nor encode it
  37. further in any way.