Possible Duplicate:
How do I save a file using the response header filename with cURL
I need to download many thousands of images in the format
http://oregondigital.org/cgi-bin/showfile.exe?CISOROOT=/baseball&CISOPTR=0
If you paste that link in a browser, it tries to download a file named 1.jp2
I want to use curl to do the same. However, when I run
curl -I 'http://oregondigital.org/cgi-bin/showfile.exe?CISOROOT=/baseball&CISOPTR=0'
the filename is reported as 404.txt which you can download and see that it is actually the file I want. I can't use the -O option because the name assigned to the file is no good, and I have technical reasons for needing the actual name used on the system.
How do I get curl to download the same file I have no trouble retrieving in my browser? Thanks.
You can use the -o option can you? eg
The solution is to use
-O -J
So...
I had to upgrade my CURL. I had v 7.19 which doesn't support -J but 7.22 (which is the latest) does.