0

I'm creating an application with rails to upload videos, for that I use the paperclip gem

My problem is that any user can download the video with the paperclip url, and i dont want that

Is there any way do:

  • Can prevent the download of attachments files with paperclip?
  • Or some configuration so that when the paperclip file url is accessed redirects to another view?
  • Or some way to hide the url in the video tag in html5?
  • Or some way to protect the download of public folder of Ruby on Rails project?
  • Or something can prevent download files in Ruby on Rails?

That is the model i use

class VideoEpisode < ActiveRecord::Base

has_attached_file :video, :url  => "/assets/episode_video/:id/:basename.:extension",
              :path => ":rails_root/public/assets/episode_video/:id/:basename.:extension"


validates_attachment_content_type :video, :content_type => /\Avideo\/.*\Z/  


end

I'm using

  • rails 4.2.5.1
  • ruby 2.1.8p440

Thanks in advance

0 Answers0