upload-file.d 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  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
  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. Use the file name "-" (a single dash) to use stdin instead of a given file.
  22. Alternately, the file name "." (a single period) may be specified instead of
  23. "-" to use stdin in non-blocking mode to allow reading server output while
  24. stdin is being uploaded.
  25. You can specify one --upload-file for each URL on the command line. Each
  26. --upload-file + URL pair specifies what to upload and to where. curl also
  27. supports "globbing" of the --upload-file argument, meaning that you can upload
  28. multiple files to a single URL by using the same URL globbing style supported
  29. in the URL.
  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.