Protecting a video file in public

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
karekanu
Forum Newbie
Posts: 1
Joined: Thu Jun 26, 2008 9:43 am

Protecting a video file in public

Post by karekanu »

I have a video files uploaded in /upload folder.
So anyone could access it directly using http://www.example.com/upload/video1.flv
I want only the registered users to download or view the video, how
could i do it using sessions?. I've used sessions to authentication the users.

Sorry for the noobness
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Protecting a video file in public

Post by Christopher »

Move the video outside of the public directory or into a protected directory. Then write a PHP script that does Access Control and have it send the file to the browser. Remember to set header properly.
(#10850)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Protecting a video file in public

Post by Kieran Huggins »

the bottom line is: if people can watch your video, they can also save it. DRM is fundamentally flawed at a conceptual level.
Post Reply