Hi.
You can do it a different way:
1. create folder for this files.
2. create in this folder file named ".htaccess"
with text:
AuthType Basic
AuthName "No access"
AuthUserFile .htnopasswd
AuthGroupFile /dev/null
Require valid-user
and nobody will upload file directly.
3. create php file (in upper folder), similar to
header("Expires: Mon, 26 Nov 1962 00:00:00
GMT");
header("Last-Modified: " . gmdate("D,d M
Y H:i:s") . " GMT");
header("Cache-Control: no-cache,
must-revalidate");
header("Pragma: no-cache");
header("Content-Type:
Application/octet-stream");
header("Content-disposition: attachment;
filename=" . $filename);
// This will work on all systems, but will need considerable
resources
// We could also loop with fread($fp, 4096) to save memory
readfile($full_path_from_root_folder . $filename);
It's a very simple way to do it. You can do it by creation
temp dir,
make simlink here to downloadible file and make here
redirection. Or
try another way.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Professional PHP Developers"
group.
To post to this group, send email to Professional-PHP googlegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribe googlegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---
|