Hi, I have group of streams in public/data folder. Here i want to download the any selected stream from datafolder. I have tried to download using ''send_data'' in my show method of controller like below: send_data(@stream.location,:filename => @stream.name,:disposition => ''download'') i have hyperlink called show ,if i press the link it is opening the file with stream as content. ex:i have cmd.txt in data folder,once i press the link it open cmd.txt as a file and in that file it will have filename itself. here i want to download the actual file. can any one suggest how to do download from any location and is is possible to download with send_data? thanks Srikanth --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Thu, Jan 29, 2009 at 3:27 PM, srikanth <gsirikanth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I have group of streams in public/data folder. > Here i want to download the any selected stream from datafolder. > > I have tried to download using ''send_data'' in my show method of > controller like below: > > send_data(@stream.location,:filename => @stream.name,:disposition => > ''download'') > > i have hyperlink called show ,if i press the link it is opening the > file with stream as content. > ex:i have cmd.txt in data folder,once i press the link it open cmd.txt > as a file and in that file it will have filename itself. > > here i want to download the actual file. > > can any one suggest how to do download from any location and is is > possible to download with send_data? > > thanks > Srikanth > > >If I''ve understood your question correctly, the file is opening in the browser and now presenting the save dialog Try using :disposition => ''attachment'' -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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, thanks for the reply result is same i.e actual file is not having any data. regards Srikanth On Thu, Jan 29, 2009 at 7:46 PM, Andrew Timberlake <andrew-642hCh26+Dt3UeSHeRwt+FaTQe2KTcn/@public.gmane.org> wrote:> On Thu, Jan 29, 2009 at 3:27 PM, srikanth <gsirikanth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> Hi, >> >> I have group of streams in public/data folder. >> Here i want to download the any selected stream from datafolder. >> >> I have tried to download using ''send_data'' in my show method of >> controller like below: >> >> send_data(@stream.location,:filename => @stream.name,:disposition => >> ''download'') >> >> i have hyperlink called show ,if i press the link it is opening the >> file with stream as content. >> ex:i have cmd.txt in data folder,once i press the link it open cmd.txt >> as a file and in that file it will have filename itself. >> >> here i want to download the actual file. >> >> can any one suggest how to do download from any location and is is >> possible to download with send_data? >> >> thanks >> Srikanth >> > > If I''ve understood your question correctly, the file is opening in the > browser and now presenting the save dialog > Try using :disposition => ''attachment'' > > -- > Andrew Timberlake > http://ramblingsonrails.com > http://www.linkedin.com/in/andrewtimberlake > > "I have never let my schooling interfere with my education" - Mark Twain > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---