If the above link is a URI representing the file ...  no, it's a
request to anotherdomain.com for getting the resource with ID 579633

when I use this url in a browser : "http://www.anotherdomain.com/
resource/download/579633"
then the file (a pdf file in this case) is automatically downloaded
I guess the site is a RoR site, and my request is processed  and the
file is sent using  send_file

so, I cannot use this url has a file url directly....   GET  "http://
www.anotherdomain.com/resource/download/579633"



On 15 sep, 03:58, Robert Walker <[email protected]> wrote:
> Kad Kerforn wrote:
> > In my app, I have an URL to download a file from a remote site ,  when
> > using this URL in a browser I download the file...
>
> > "http://www.anotherdomain.com/resource/download/579633";
>
> > but I need to to get the content of this file within my app , as I
> > must encode it and transfer to another app
>
> > if I use this url with open-uri, I get the html page, not the file
> > itself......
>
> I'm not following you.
>
> If the above link is a URI representing the file (with the appropriate
> content-type) then open-uri should get the file. Of course, if that URI
> represents an HTML page then yes, you would get an HTML page.
>
> HTTP is content agnostic. It will simple GET (or POST, PUT, DELETE,
> etc.) whatever the URI represents.
>
> OpenURI is just a wrapper around net/http, net/https & 
> net/ftp:http://www.ruby-doc.org/core/classes/OpenURI.html
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to