Temporary link in PHP
Leave a Comment so far
Leave a comment
March 17, 2004, 5:37 pm
Filed under: notes/Programming
Filed under: notes/Programming
Create a download handler:
/files/download.php
This file streams a document given certain parameters.
/files/download.php?id=e45fg6f7a7c7b776d4cc4e56&fileid=4001
The id could be an MD5 of the SessionID for that user
and the download handler just checks the session ID with the one passed in
The 4001 could be a db lookup giving information about the file.
(path to file, MIME type, etc)
Then, just stream the file back to the user with the appropriate Headers
Content-type: application/zip
Content-disposition: attachment; filename=file4001.zip
Advertisement
Leave a Comment
Leave a Comment so far
Leave a comment


