I'm using Ruby on rails and I have videos that I don't want users to download.
Where do I store the videos? From the name of the folder "Public" maybe this is a really stupid question, but is that an ok ok place to store the videos?
I'm using Ruby on rails and I have videos that I don't want users to download.
Where do I store the videos? From the name of the folder "Public" maybe this is a really stupid question, but is that an ok ok place to store the videos?
Users can download anything they can see. If you don't want anyone to access those videos, don't put them on the web.
Perhaps I don't understand your question; if so, please clarify.
Store your files somewhere other than the public directory when you upload them, in say for instance, downloads
and then you can send files to a user with a controller action like:
def download
send_file '/home/apps/myapp/downloads/video.mp4'
end
That way you can authenticate the user with before filters and the file won't be available publicly.
Further reading: http://www.therailsway.com/2009/2/22/file-downloads-done-right