cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problem downloading file from a redirect

From: <balt3_at_inside.net>
Date: Mon, 9 May 2005 22:14:20 +1000

Hi all
 
I'm trying to automatically download a file from a redirect link. So far, I
got the forms authentication as well as the loading of the page where the
download link is located working:
 
curl -c cookies.txt -b cookies.txt -d
"_submitted=1&_sessionid=%20&username=me&password=mypass&_submit=Submit"
http://www.url.com/perl/login.pl -O -L http://www.url.com/perl/dl.pl?ID=2
 
The second step however is where it fails. What happens when clicking on
this URL http://www.url.com/perl/dl.pl?ID=2 is, it's supposed to redirect to
xyz.gz which should then be downloaded. Instead, I receive the file login.pl
saved locally and it contains this:
 
<meta http-equiv='Refresh' content='0;URL=home.pl'>
If you see this, your system does not support automatic redirects. <a
href='home.pl'>Click here to continue</a>
</body></html>

 
Weird, I did specify the -L option to follow redirects.
 

Any ideas anyone?

Cheers

- Balt
Received on 2005-05-09