videos in "safe directory"

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
696020
Forum Newbie
Posts: 16
Joined: Wed Aug 16, 2006 11:45 pm

videos in "safe directory"

Post by 696020 »

Hi Everyone,

I'm trying to build a script that will display a .mov that is located in a directory outside my public_html directory for security reasons. I want to use the script to first ensure that the request to view the movie came from a specific http host, and if not, exit before the video is displayed. I also want to avoid people fishing in the directory where the videos are located, hence having outside the public dir.

Any ideas on how to tackle this, or know of any existing scripts that would work?
696020
Forum Newbie
Posts: 16
Joined: Wed Aug 16, 2006 11:45 pm

Post by 696020 »

I imagine that this will involve using fopen() and fclose() but haven't gotten a real example to work yet.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

readfile() may be of interest.
Post Reply