Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl unescape output file name

if URL has %20 in file name, specify -O will keep it, while space is preferred.

libcurl has curl_easy_unescape, but the curl binary in bash doesn't seem to have an easy way to unescape output file name. However, wget does unescape by default.

currently I extract file name from url, unescape it, then use -o.

I would like to know if an easier/builtin way exists.

like image 545
user1477675 Avatar asked Oct 07 '22 01:10

user1477675


1 Answers

No, unfortunately there's currently no way to tell curl to URL decode the file name -O creates. It feels like a good idea to offer in the future...

like image 84
Daniel Stenberg Avatar answered Oct 13 '22 10:10

Daniel Stenberg