1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

curl.1: Explain remote-name behavior if file already exists

.. also warn about letting the server pick the filename.
This commit is contained in:
Jay Satiro 2016-01-29 03:28:48 -05:00
parent bdb465274f
commit 96596334c8

View File

@ -828,8 +828,17 @@ cookies when they're closed down.
server-specified Content-Disposition filename instead of extracting a filename server-specified Content-Disposition filename instead of extracting a filename
from the URL. from the URL.
If the server specifies a file name and a file with that name already exists
in the current working directory it will not be overwritten and an error will
occur. If the server doesn't specify a file name then this option has no
effect.
There's no attempt to decode %-sequences (yet) in the provided file name, so There's no attempt to decode %-sequences (yet) in the provided file name, so
this option may provide you with rather unexpected file names. this option may provide you with rather unexpected file names.
\fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
rogue server could send you the name of a DLL or other file that could possibly
be loaded automatically by Windows or some third party software.
.IP "-k, --insecure" .IP "-k, --insecure"
(SSL) This option explicitly allows curl to perform "insecure" SSL connections (SSL) This option explicitly allows curl to perform "insecure" SSL connections
and transfers. All SSL connections are attempted to be made secure by using and transfers. All SSL connections are attempted to be made secure by using
@ -1190,12 +1199,15 @@ output to be done to stdout.
Write output to a local file named like the remote file we get. (Only the file Write output to a local file named like the remote file we get. (Only the file
part of the remote file is used, the path is cut off.) part of the remote file is used, the path is cut off.)
The remote file name to use for saving is extracted from the given URL, The file will be saved in the current working directory. If you want the file
nothing else. saved in a different directory, make sure you change the current working
directory before invoking curl with this option.
Consequentially, the file will be saved in the current working directory. If The remote file name to use for saving is extracted from the given URL, nothing
you want the file saved in a different directory, make sure you change current else, and if it already exists it will be overwritten. If you want the server
working directory before you invoke curl with the \fB-O, --remote-name\fP flag! to be able to choose the file name refer to \fI-J, --remote-header-name\fP
which can be used in addition to this option. If the server chooses a file name
and that name already exists it will not be overwritten.
There is no URL decoding done on the file name. If it has %20 or other URL There is no URL decoding done on the file name. If it has %20 or other URL
encoded parts of the name, they will end up as-is as file name. encoded parts of the name, they will end up as-is as file name.