Not too familure with a chroot'd web setup and I dont know if my ISP has some security that I dont know about. I tried some tests with file_exists() and it doesnt seemt to be able to get to the files either. I've put in an info request to my ISP but they are usually not much help with something this advanced. Is there anything else I can do to further diagnose this problem?
Thanks again, Aaron "Greg Donald" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 2004-08-23 at 13:02, Aaron Todd wrote: >> I'm trying to use readfile() to allow a user to download a file that is >> outside of my webroot. >> >> webroot = /var/www/html >> downloads dir = /var/www/downloads >> >> Here is the code that I have been using: >> $file = "/var/www/downloads/test.txt"; >> header("Content-Description: File Transfer"); >> header("Content-Type: application/force-download"); >> header("Content-Disposition: attachment; filename=".basename($file)); >> readfile($file); >> >> This code will work if I change the path to the webroot path, but not the >> downloads dir path. I get an error saying "Unable to access" and then >> "failed to open stream: No such file or directory". >> >> I have given whe I believe is the correct rights for the downloads dir >> and >> also the file...rwxr-xr-x for both. >> >> Anyone have any idea why this isnt working? > > Is the download directory outside a chroot'd web setup perhaps? Or > maybe your provider has some security you don't know about? > > There are some file related functions you can debug with, like > is_readable(), and file_exists(). > > > -- > Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php