friends, am using send_file function controller def download @event = Event.find(:first, :conditions => [''id = ?'',params[:id]]) #@path=@event.file @path=params[:file_path] send_file("#{@path}",:type => ''all'') end view file <% temp_path=@event.file %> <a href="/event/download?id=<%=@event.id%>&file_path=<%=temp_path%>">Download </a> I got this error... Cannot read file event11991.gif Thanks. -- Posted via http://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-/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 -~----------~----~----~----~------~----~------~--~---
works fine -- Posted via http://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-/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 do not have read permissions on that file, or the file does not exist. ----- Ryan Bigg Freelancer http://frozenplague.net On 26/11/2008, at 10:20 PM, Smarty 2k wrote:> > friends, > > am using send_file function > > controller > > def download > @event = Event.find(:first, :conditions => [''id = ?'',params[:id]]) > #@path=@event.file > @path=params[:file_path] > send_file("#{@path}",:type => ''all'') > end > > view file > > <% temp_path=@event.file %> > <a > href="/event/download?id=<%=@event.id%>&file_path=<%=temp_path > %>">Download > </a> > > I got this error... > > Cannot read file event11991.gif > > > Thanks. > -- > Posted via http://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-/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 -~----------~----~----~----~------~----~------~--~---