user1477675
user1477675

Reputation: 96

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.

Upvotes: 5

Views: 1558

Answers (1)

Daniel Stenberg
Daniel Stenberg

Reputation: 58024

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...

Upvotes: 4

Related Questions