remote-header-name.d 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. c: Copyright (C) 1998 - 2022, 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. If the server does not specify a file name then this option has no
  22. 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. **WARNING**: Exercise judicious use of this option, especially on Windows. A
  26. rogue server could send you the name of a DLL or other file that could be
  27. loaded automatically by Windows or some third party software.