[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Absolutely lost with URI/Net/HTTP

guest

7/3/2007 12:01:00 AM

is it possible to download a file with a PHP hidden URL?

when the link is clicked on in firefox, it will prompt the user to
either open or save, for example...

http://www.esnips.com/nsdoc/b2a4a221-2590-486f-a314-469a4721e1ed/?id=118...

how can i download this file using ruby?

or if that isn't possible, to tell firefox to open that url?

thanks!

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

2 Answers

Gregory Brown

7/3/2007 12:20:00 AM

0

On 7/2/07, Guest <Guest@bugmenot.com> wrote:
> is it possible to download a file with a PHP hidden URL?
>
> when the link is clicked on in firefox, it will prompt the user to
> either open or save, for example...
>
> http://www.esnips.com/nsdoc/b2a4a221-2590-486f-a314-469a4721e1ed/?id=118...
>
> how can i download this file using ruby?

require "open-uri"

File.open("my.mp3","wb") do |file|
file << open("http://www.e...)
end

Gregory Brown

7/3/2007 12:21:00 AM

0

On 7/2/07, Gregory Brown <gregory.t.brown@gmail.com> wrote:

> > how can i download this file using ruby?
>
> require "open-uri"
>
> File.open("my.mp3","wb") do |file|
> file << open("http://www.e...)
> end

whoops, that should be open("http://...").read