HTTP dowloading help

A

Andrew Walrond

I wonder if any http experts out there can save me some time...

I currently download files using http with...

def http(server,dir,file)
repeat(server,dir,file) { |localFile|
http = Net::HTTP.new(server)
File.open(localFile,"w") { |dest| http.get(path(dir,file),nil,dest) }
}
end

...which works great for simple links, but fails miserably with more complicated stuff; eg sourceforge.

Anybody got a small bit of code that will handle more complicated stuff?

I could work it out, but my head is already too full and I've avoided touching html so far...

TIA Andrew
 

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,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top