Results 1 to 2 of 2
Hybrid View
-
09-13-2006, 01:19 PM #1WHT Addict
- Join Date
- Sep 2004
- Posts
- 167
Access File Outside Home Directory
I have a webpage (PHP) that I wish to be able to link to files outside of the home directory (not accessible to browse to) to download them. Example:
Downloadable File Location:
/home/user/folder
Page I want to link to this file on:
/home/user/public_html/page.php
Anyone have any idea how I can do this? These are files I want to create for each user, but I do not want anyone to be able to browse to this file location folder and download the individual user folders.Bobbie
Cornerstone IT
-
09-13-2006, 02:07 PM #2Web Hosting Evangelist
- Join Date
- Apr 2005
- Posts
- 522
It's been mentioned a few times here. You're storing files below DocumentRoot, and you need to use readfile() with header() in order to serve files that are otherwise unaccessible directly via URL. Search the forums, there's allready the entire code posted, you should just change the paths and you're good to go.