3
Quote:
bd_csmc wrote:
if you are, a buddy of mine sent me a couple of small lines of code, when implemented, they make it pretty much impossible to determine the origin/location of any download (the code hides remote *or* local file urls the same way), he uses it in several php-nuke modules that he has written, but it's regular php, not CMS-specific
I did something along these lines recently, although I customised wmpdownloads (and added the uploader to it). Basically my approach was to upload all files to a directory off the web folder and then when a file was requested (and verified that the user can download it according to group permissions) I've got some php to retrieve the file and output it, I can't remember where I found it so I'll just post what I used:
$dir="<path to uploads folder>";
$file=$dir.$url;
<any other headers you want to use>
header("Content-length: ".filesize($file));
header("Content-Disposition: inline; filename=\"".$logourl."\"");
readfile("$file");
I've taken quite a simplistic approach in that each file is saved to disk with it's id ($url above) and the original file name ($logourl) is saved as an attribute in the db that admins can edit if they choose, then it's just output with the filename when the download is requested.