upload-file.d 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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. ---
  14. This transfers the specified local file to the remote URL. If there is no file
  15. part in the specified URL, curl will append the local file name. NOTE that you
  16. must use a trailing / on the last directory to really prove to Curl that there
  17. is no file name or curl will think that your last directory name is the remote
  18. file name to use. That will most likely cause the upload operation to fail. If
  19. this is used on an HTTP(S) server, the PUT command will be used.
  20. Use the file name "-" (a single dash) to use stdin instead of a given file.
  21. Alternately, the file name "." (a single period) may be specified instead of
  22. "-" to use stdin in non-blocking mode to allow reading server output while
  23. stdin is being uploaded.
  24. You can specify one --upload-file for each URL on the command line. Each
  25. --upload-file + URL pair specifies what to upload and to where. curl also
  26. supports "globbing" of the --upload-file argument, meaning that you can upload
  27. multiple files to a single URL by using the same URL globbing style supported
  28. in the URL.
  29. When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322
  30. formatted. It has to feature the necessary set of headers and mail body
  31. formatted correctly by the user as curl will not transcode nor encode it
  32. further in any way.