How to allow only the owner of the uploaded file(s) to access these file(s)

Hello!

I am allowing my users to upload files, and it will end up in public \videos\.

How can I ensure that user A can see only his files? Is there a plug in for this?

Thank You!

assuming everything is setup like this:

Model User: has_many :videos

Model Videos: belongs_to :user

somewhere in the session you have stored the logged in user and can access him with a method like current_user then in you controller:

current_user.videos.find(params[:id])

or whatever find is necessary