|
Posted by Captain Paralytic on 02/16/07 11:52
On 16 Feb, 11:33, n...@spray.se wrote:
> Hello!
> I'm trying to secure pdf-files from users that are not logged in on a
> site.
> What I have tried now is to make a .htaccess file in the directory
> where the pdf's are with "deny from all" which stops everyone from
> downloading them. Then in the member-area when a user wants to
> download a pdf a php-script copies the pdf-file from the secured-
> folder to a temp-folder and renames it to some random file-name that
> the user can download. Then when the user are ready with the download
> I want the temp-file to be deleted automaticly to prohibit other non-
> members to find it? How can I do this?
> Maybe someone have another totally different solution to secure files?
> Regards
> /Samuel
Read the file's contents and send it to the terminal with the correct
headers. No need to write a temp file at all.
You will use similar code to this, replacing the database with your
"hidden" files.
Also rather than using .htaccess to deny access, just hold the files
in a directory that isn't in the http root structure.
Navigation:
[Reply to this message]
|