# Absolutely lost with URI/Net/HTTP

**URL:** <https://rubytalk.org/t/absolutely-lost-with-uri-net-http/38812>\
**Category:** ruby-talk\
**Created:** [3 July 2007 00:00 UTC](https://rubytalk.org/t/absolutely-lost-with-uri-net-http/38812 "2007-07-03T00:00:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guest7](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Guest7](https://rubytalk.org/u/Guest7)\
**Post date:** [3 July 2007 00:00 UTC](https://rubytalk.org/t/absolutely-lost-with-uri-net-http/38812/1 "2007-07-03T00:00:42Z")

</div>

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=1183359840917](http://www.esnips.com/nsdoc/b2a4a221-2590-486f-a314-469a4721e1ed/?id=1183359840917)

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-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Greg\_Brown1](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@Greg\_Brown1](https://rubytalk.org/u/Greg_Brown1)\
**Post date:** [3 July 2007 00:20 UTC](https://rubytalk.org/t/absolutely-lost-with-uri-net-http/38812/2 "2007-07-03T00:20:03Z")

</div>

require "open-uri"

File.open("my.mp3","wb") do |file|  
&nbsp;&nbsp;file \<\< open("[http://www.es](http://www.es)...")  
end

> **···**
>
> 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=1183359840917](http://www.esnips.com/nsdoc/b2a4a221-2590-486f-a314-469a4721e1ed/?id=1183359840917)
> > 
> > how can i download this file using ruby?

---

<div class="post-metadata">

**Author:** ![Greg\_Brown1](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@Greg\_Brown1](https://rubytalk.org/u/Greg_Brown1)\
**Post date:** [3 July 2007 00:20 UTC](https://rubytalk.org/t/absolutely-lost-with-uri-net-http/38812/3 "2007-07-03T00:20:46Z")

</div>

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

> **···**
>
> 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|  
> > &nbsp;&nbsp;file \<\< open("[http://www.es](http://www.es)...")  
> > end
