Not that hard conceptually. A database table with 3 columns:
Code:
fileid - unique ID (like an MD5 hash of the filename)
expiry - datetime
path - path to the file
When a user accesses something like: http://example.com/file-share.php?fileid
Then the script on that page grabs the record from the database where fileid is the uniqueID. It then checks the expiry date to make sure the link isn't already expired and then the script simply serves up the file (the path of which is stored in the path column in the database) via Content-Type: application/octet-stream.
This might help you out on how to serve the file:
http://www.phpclasses.org/package/22...e-support.html
Best of luck!
Last edited by aj_nsc; 05-01-2012 at 02:00 PM.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
Bookmarks