Hi,

I am storing movie data into db.
Now I want to access movie from db and create a link to allow download
movie.

But when I click on the link It simply open the movie player and does
not play the movie. player give error in movie file.

When I try to save_as link and save the movie file and play It work's
fine.

My code like:

=============== Controller
def download
      @movie = Movies.find(params[:file])
      @headers["Content-Type"] = "video/x-ms-wmv; charset=utf-8"
      render :text => @movie.file
end

=============== View

<%= link_to movie.filename, {:action => 'download', :id =>
movie.filename, :file => movie.id }%>

=======================


I just want to make a this link download on single click so it prompt
me.

Please let me know what can I do ? I really need some help.

Regards,
Deepak
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to