Activities

August 2010
M T W T F S S
« Jul   Sep »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Download a file protected by Basic authentication

I have a requirement to download a url which protected by the password on a remote server. I can't do it locally since the download file is in GB size.

[root@host.domain.com] feeds >> wget http://clients.xmlteam.com/downloads/feedfetcher/basic/feedfetcher-basic.2007.01.16.tar.gz
--13:13:18--  http://clients.xmlteam.com/downloads/feedfetcher/basic/feedfetcher-basic.2007.01.16.tar.gz
           => `feedfetcher-basic.2007.01.16.tar.gz'
Resolving clients.xmlteam.com... 204.15.197.99
Connecting to clients.xmlteam.com|204.15.197.99|:80... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

The correct usage is $wget –http-user=user –http-password=pass

[root@host.domain.com] feeds >> wget http://clients.xmlteam.com/downloads/feedfetcher/basic/feedfetcher-basic.2007.01.16.tar.gz  --http-user=user  --http-password=pass
--13:23:04--  http://clients.xmlteam.com/downloads/feedfetcher/basic/feedfetcher-basic.2007.01.16.tar.gz
           => `feedfetcher-basic.2007.01.16.tar.gz.1'
Resolving clients.xmlteam.com... 204.15.197.99
Connecting to clients.xmlteam.com|204.15.197.99|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 120,493 (118K) [application/x-gzip]

100%[====================================>] 120,493      494.43K/s

13:23:04 (494.16 KB/s) - `feedfetcher-basic.2007.01.16.tar.gz.1' saved [120493/120493]

That works !!!!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>