remote-header-name.d 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. SPDX-License-Identifier: curl
  3. Long: remote-header-name
  4. Short: J
  5. Protocols: HTTP
  6. Help: Use the header-provided filename
  7. Category: output
  8. Example: -OJ https://example.com/file
  9. Added: 7.20.0
  10. See-also: remote-name
  11. Multi: boolean
  12. ---
  13. This option tells the --remote-name option to use the server-specified
  14. Content-Disposition filename instead of extracting a filename from the URL. If
  15. the server-provided file name contains a path, that will be stripped off
  16. before the file name is used.
  17. The file is saved in the current directory, or in the directory specified with
  18. --output-dir.
  19. If the server specifies a file name and a file with that name already exists
  20. in the destination directory, it will not be overwritten and an error will
  21. occur - unless you allow it by using the --clobber option. If the server does
  22. not specify a file name then this option has no effect.
  23. There's no attempt to decode %-sequences (yet) in the provided file name, so
  24. this option may provide you with rather unexpected file names.
  25. This feature uses the name from the "filename" field, it does not yet support
  26. the "filename*" field (filenames with explicit character sets).
  27. **WARNING**: Exercise judicious use of this option, especially on Windows. A
  28. rogue server could send you the name of a DLL or other file that could be
  29. loaded automatically by Windows or some third party software.