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