Easiest way to ask the browser to simply "display" a file instead of
downloading it is to do the following in your controller's action:

send_file(path, :type => 'application/pdf', :disposition => 'inline')

The :disposition is the important part; typically you'll be setting
this to either 'inline' to "force" the browser to view the file inline
or 'attachment' to "force" it to download (I use quotes because
nothing is really guaranteed in the browser world).

On Jun 18, 1:25 pm, Dharmdip Rathod <rails-mailing-l...@andreas-s.net>
wrote:
> Thanks Colin ,
>
>     When i put one file in public folder and after accessing thought URL
> it opens in browser now i know what happens . I have used attachment_fu
> for file uploading, and files is stored here
> (/groups_file/000/0045/test.pdf) so i need to make URL pertaining to
> this path that's way i can open file in browser i think so.
>
> Thanks and Regards,
> Dharmdip
> --
> 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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to