tags:

views:

123

answers:

2

This question relates to the command line version of cURL.

I'm trying to download a file from a cgi script.

http://someserver/perl/dl.pl?ID=2

Using a browser the filename comes up as 'remotefilename.gz' cURL wants to save the file as 'dl.pl?ID=2'

How do I get cURL to save to a file with the filename from the response header??

A: 

you can try the -o or -O option.

ghostdog74
-o Asks for a filename to save to-O saves to disk as dl.pl?ID=2
John
+1  A: 

if you have a new enough curl, -J/--remote-header-name is what you want

Daniel Stenberg