2023-01-02 20:51:48 +08:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2016-11-16 06:44:58 +08:00
|
|
|
Long: remote-header-name
|
|
|
|
Short: J
|
|
|
|
Protocols: HTTP
|
|
|
|
Help: Use the header-provided filename
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: output
|
2021-08-31 22:37:14 +08:00
|
|
|
Example: -OJ https://example.com/file
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 7.20.0
|
2021-11-15 22:58:20 +08:00
|
|
|
See-also: remote-name
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: boolean
|
2016-11-16 06:44:58 +08:00
|
|
|
---
|
|
|
|
This option tells the --remote-name option to use the server-specified
|
2022-01-09 18:34:37 +08:00
|
|
|
Content-Disposition filename instead of extracting a filename from the URL. If
|
|
|
|
the server-provided file name contains a path, that will be stripped off
|
|
|
|
before the file name is used.
|
|
|
|
|
|
|
|
The file is saved in the current directory, or in the directory specified with
|
|
|
|
--output-dir.
|
2016-11-16 06:44:58 +08:00
|
|
|
|
|
|
|
If the server specifies a file name and a file with that name already exists
|
2022-01-09 18:34:37 +08:00
|
|
|
in the destination directory, it will not be overwritten and an error will
|
2023-02-18 17:18:57 +08:00
|
|
|
occur - unless you allow it by using the --clobber option. If the server does
|
|
|
|
not specify a file name then this option has no effect.
|
2016-11-16 06:44:58 +08:00
|
|
|
|
|
|
|
There's no attempt to decode %-sequences (yet) in the provided file name, so
|
|
|
|
this option may provide you with rather unexpected file names.
|
|
|
|
|
2023-02-18 17:18:57 +08:00
|
|
|
This feature uses the name from the "filename" field, it does not yet support
|
|
|
|
the "filename*" field (filenames with explicit character sets).
|
|
|
|
|
2021-03-22 23:50:57 +08:00
|
|
|
**WARNING**: Exercise judicious use of this option, especially on Windows. A
|
2021-11-26 15:46:59 +08:00
|
|
|
rogue server could send you the name of a DLL or other file that could be
|
|
|
|
loaded automatically by Windows or some third party software.
|