You could put a link to the public_filename instead of a show method - then
rendering download will be a function of the user''s browser settings -
in my
case images will show in firefox, pdf''s will download etc...
I could be completely wrong about this though :)
On 7/27/07, Tushar <tusharranka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> I have an app that uses attachment_fu plugin with database at the
> backend for attachments. I have no restriction on Mime types that can
> be stored. The problem I''m having is related to rendering the
files
> (allowing users to download the file.
>
> def show
> @stored_file = StoredFile.find(params[:id])
> ##### How do I render the file to the user:
> @stored_file.db_file.data
> end
>
> I tried respond_to, but that doesn''t work for un-registered Mime
> Types.
>
> Any help is greatly appreciated
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---