Nitsan Bin-Nun wrote:
Neh, we don't have plenty of these in Israel, don't count it in as an issue.
Serving the files won't be an overkill for my harddrive / cpu usage /
There is a better way to serve the files with/without PHP and keeping them
outsite of the HTTP root?
If you want to use http the code I provided in my first response works
very well for files I serve outside the web root.
make a dummy directory in the web root.
In that dummy directory put a single php file - called "dummy.php" or
Have that file check the users credentials etc. (IE via session id) -
put a .htaccess file in the dummy directory containing:
RewriteRule ^*\.iso$ dummy.php
That way a request to /dummy/something.iso
is handled by dummy.php - which then can figure out what file is wanted
via the $thispage variable, verify the user has permission to download
it via sessions etc. (and sends a 403 header if they don't), verifies
that the file exists (and sends a 404 header if it doesn't), and then
uses the code I outlined in my first post to grab the file from the real
location that is outside the web root and sends it to the requesting client.
It works quite well for me.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php