Forum: Ruby on Rails Download problem!!!!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
60bb25c88eda9e783e1d22653e26f86d?d=identicon&s=25 Smarty 2k (smartee)
on 2008-11-26 12:50
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.
60bb25c88eda9e783e1d22653e26f86d?d=identicon&s=25 Smarty 2k (smartee)
on 2008-11-26 12:58
works fine
9a2a53db8e9b4476038c94a64b32833f?d=identicon&s=25 Ryan Bigg (ryan-bigg)
on 2008-11-26 13:23
(Received via mailing list)
You do not have read permissions on that file, or the file does not
exist.
-----
Ryan Bigg
Freelancer
http://frozenplague.net
This topic is locked and can not be replied to.