cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: [ curl-Bugs-631028 ] Fails saveing using -O if URL has spaces

From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Wed, 6 Nov 2002 08:23:09 -0500

Just curious whether this logic would make sense:

curl examines the URL as given to it. If it finds any non-standard URL characters in the path or filename parts (e.g. " ", but not any of "/#?&%+...") then it URL-encodes each filename or path part before sending to the remote computer, else it sends it as is. Either way, if "-O" is used, the file name as given by the user should be used.

If it could be written in a "safe" enough manner, it should be the default behavior, which could be disabled by a special flag if needed.

--Kevin

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Wed 11/06/02 5:55 AM

On Wed, 6 Nov 2002, Philippe Lhoste wrote:

> > curl -O http://1.0.0.111/Copy%20of%20tagada.shtml
> Got it, but wrote "Copy%20of%20tagada.shtml"...

> That's not very nice, perhaps here Curl should transform all URL entities
> (%xx) to corresponding characters. As long as they are not illegal for the
> current OS, which can be tricky to do in a portable way. Or just use a
> script to post-process the file name...

... or use -o to provide whatever name you think is fit. ;-)

-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
Received on 2002-11-06