Keeping some files private
Posted
by
user490895
on Stack Overflow
See other posts from Stack Overflow
or by user490895
Published on 2011-01-07T06:51:18Z
Indexed on
2011/01/07
6:53 UTC
Read the original article
Hit count: 167
Hi,
I was trying to create a directory of private files that could only be accessed when a user logs in. To do this, I used a folder outside the web directory, and then php to access it, if allowed.
Here's an example:
function display_movie($file){
printf("<video id='movie' width='960' height='416' controls='controls' onerror='fix()'>
<source src='movie.php?file=%s' type='video/ogg; codecs=\"theora, vorbis\"'>
</video>", rawurlencode($file)
);
}
This works great for images, but breaks the media player. Also, I've only tested this locally on a Linux machine.
Any ideas? Thanks.
© Stack Overflow or respective owner