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