Protecting contect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Thumper
Forum Newbie
Posts: 1
Joined: Mon Jan 25, 2010 8:14 pm

Protecting contect

Post by Thumper »

I have a problem. I would like to put some videos on my server for downloading but I would like them to be only for paying members. I have some content thieves who have stolen from me before.

I know how to do most of this. By adding an index.html file to the directory people cannot get a file listing for the director(ies) and through some other code I can allow only paying members to seea file from there.. What I cannot see how to prevent is if someone knows the name and directory location of the file. If they call for the file directly them I see no way to stop them other than using .htaccess which means I'd have to add hundreds of people to an .htaccess file, a huge and messy undertaking. Is there and other way around this?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Protecting contect

Post by alex.barylski »

certainly...storing the videos in a database or outside document root and using a proxy script to actually fetch the contents of the video on request. Th proxy script would then check whether the user had valida access permissions to download contents and allow or deny download accordingly. It's a relatively simple system, probably something already in existance floating around, if you look hard enough.

Try HotScripts, SourceForge, in that order.

Cheers,
Alex
User avatar
SimpleManWeb
Forum Commoner
Posts: 57
Joined: Wed Dec 30, 2009 4:15 pm
Location: New Hampshire, USA

Re: Protecting contect

Post by SimpleManWeb »

I second the proxy script idea. Here's a site that discusses some details about how it all works.

http://advosys.ca/papers/web/61-web-sec ... ml#datadir
Post Reply