2
1
I need to download a file from a website which has a URL formatted like:
http://www.server.com/downloads/1234/
This redirects to a .zip file which has to be saved. There is also a need to authenticate based on username and password.
I tried to use wget
, curl
and lynx
with no luck.
UPDATE:
wget
doesnt work with redirection. It simply downloads the webpage instead of the zip file.curl
gives the error "Maximum redirection exceeded > 50 "lynx
also gives the same error.
1Are you getting errors or is it simply not working? – None – 2011-08-09T05:18:56.707
2How did you invoke lynx/curl/wget? What error did you get? – Noufal Ibrahim – 2011-08-09T05:19:28.260
I have updated the question.. – Vicky – 2011-08-09T05:44:32.637
1If you have to log in and then the site redirects then you'll have to authenticate (submit your user/pass), probably a POST, then use the cookie the is returned in the next request. The curl error you're getting is probably you missing a parameter or cookie in the redirection (e.g. they set a Session cookie and you're not passing it on the redirection so it redirect you away, then redirect you back...infinite loop perhaps???). – None – 2011-08-09T05:49:31.197