Download a file from a site that needs authentication

A

Azalar ---

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.
 
A

Azalar ---

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.
 
H

Heesob Park

2008/9/22 Azalar --- said:
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.
require 'open-uri'
open("save.file","w").write(open(url,:http_basic_authentication =>
['user','pass']).read)

Regards,

Park Heesob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top