remote-header-name.d 1.2 KB

123456789101112131415161718192021222324252627282930
  1. c: Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, 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. ---
  12. This option tells the --remote-name option to use the server-specified
  13. Content-Disposition filename instead of extracting a filename from the URL. If
  14. the server-provided file name contains a path, that will be stripped off
  15. before the file name is used.
  16. The file is saved in the current directory, or in the directory specified with
  17. --output-dir.
  18. If the server specifies a file name and a file with that name already exists
  19. in the destination directory, it will not be overwritten and an error will
  20. occur. If the server does not specify a file name then this option has no
  21. effect.
  22. There's no attempt to decode %-sequences (yet) in the provided file name, so
  23. this option may provide you with rather unexpected file names.
  24. **WARNING**: Exercise judicious use of this option, especially on Windows. A
  25. rogue server could send you the name of a DLL or other file that could be
  26. loaded automatically by Windows or some third party software.