I want to download a file previously uploaded in the database Its like providing a link and when clicked the file is downloaded to your file system How?? can i do that, I have no idea about it Please can anyone help me Online --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You should use the send_file or send_data methods available from the controller send_data method(if the file is stored as a BLOB in the db) send_data image.data, :type => image.content_type, :disposition => ''attachment'' in this example (from the api docs) this implies you have an activerecord model called Image, with the fields ''data'' and ''content_type'' send_file method (if the file is in the file system (can be outside rails/public root) send_file ''/path/to.jpeg'', :type => ''image/jpeg'', :disposition => ''attachment'' Look them up here: www.gotapi.com/rubyrails Joe On Jan 13, 5:59 am, nettome <gsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to download a file previously uploaded in the database > Its like providing a link and when clicked the file is downloaded to > your file system > How?? can i do that, I have no idea about it > Please can anyone help me > > Online--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
also check out attachment_fu plugin for all round file upload/download handling. On Jan 13, 5:59 am, nettome <gsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to download a file previously uploaded in the database > Its like providing a link and when clicked the file is downloaded to > your file system > How?? can i do that, I have no idea about it > Please can anyone help me > > Online--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanks man i would look into it On Jan 13, 9:58 pm, Wildtangent <wildtang...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> also check out attachment_fu plugin for all round file upload/download > handling. > > On Jan 13, 5:59 am, nettome <gsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I want to download a file previously uploaded in the database > > Its like providing a link and when clicked the file is downloaded to > > your file system > > How?? can i do that, I have no idea about it > > Please can anyone help me > > > Online--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hi, I want to provide a link "Download Image" which when clicked the image is downloaded to the desired file system Please can u help , I used the send_data function in my program for displaying the image. On Jan 14, 9:25 am, nettome <gsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> thanks man i would look into it > > On Jan 13, 9:58 pm, Wildtangent <wildtang...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > also check out attachment_fu plugin for all round file upload/download > > handling. > > > On Jan 13, 5:59 am, nettome <gsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I want to download a file previously uploaded in the database > > > Its like providing a link and when clicked the file is downloaded to > > > your file system > > > How?? can i do that, I have no idea about it > > > Please can anyone help me > > > > Online--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---