accessing password protected directories
Posted: Wed Nov 14, 2007 9:24 am
I've password protected a directory in my site, but I want a php script to be able to access it to download a file from it. How can I do this? Here is the download script:
Thanks
Code: Select all
$fname = "file.mxp";
$fpath = "folders/$fname";
$fsize = filesize($fpath);
$bufsize = 20000;
header("HTTP/1.1 200 OK");
header("Content-Length: $fsize");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=$fname");
header("Content-Transfer-Encoding: binary");