[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Download a file from a site that needs authentication

Azalar ---

9/20/2008 9:29:00 PM

I have a membership to a web site that needs authentication before you
can download the file.
How can i download the file and authenticate so that it returns me the
file?
My initial research suggest i need to use basic http authentication but
I am not sure how to use this to do what i want.
--
Posted via http://www.ruby-....

3 Answers

Azalar ---

9/22/2008 10:02:00 AM

0

No one ever needed to logon to a web site using basic http
authentication to access a file?
I would have thought this is quite a common task.


Azalar --- wrote:
> I have a membership to a web site that needs authentication before you
> can download the file.
> How can i download the file and authenticate so that it returns me the
> file?
> My initial research suggest i need to use basic http authentication but
> I am not sure how to use this to do what i want.

--
Posted via http://www.ruby-....

Bill Kelly

9/22/2008 10:23:00 AM

0


From: "Azalar ---" <pteale@gmail.com>
>
> No one ever needed to logon to a web site using basic http
> authentication to access a file?
> I would have thought this is quite a common task.

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...


Regards,

Bill



Heesob Park

9/22/2008 10:30:00 AM

0

2008/9/22 Azalar --- <pteale@gmail.com>:
> No one ever needed to logon to a web site using basic http
> authentication to access a file?
> I would have thought this is quite a common task.
>
>
> Azalar --- wrote:
>> I have a membership to a web site that needs authentication before you
>> can download the file.
>> How can i download the file and authenticate so that it returns me the
>> file?
>> My initial research suggest i need to use basic http authentication but
>> I am not sure how to use this to do what i want.
>
require 'open-uri'
open("save.file","w").write(open(url,:http_basic_authentication =>
['user','pass']).read)

Regards,

Park Heesob