bigheadedd Posted October 15, 2010 Share Posted October 15, 2010 Hi, I'm wondering if anyone knows of any good information regarding downloading files. I'm looking into creating a relatively simple download system, where people will be sent a link say (download.php?id=dnjwaAYFDAg734) (where id would be an encrypted value, and obviously a lot longer!). That script would then decode the id number and allow the user to download the appropriate file. Any help would be hugely grateful as I'm a little unsure of where to go and a quick look through google doesn't show too much up. Thanks Edd Quote Link to comment https://forums.phpfreaks.com/topic/215941-downloading-encrypted-files/ Share on other sites More sharing options...
premiso Posted October 15, 2010 Share Posted October 15, 2010 I think you would want a hash. I would not really bother trying to do encryption. What would be a better method is have two tables in your SQL Database, one that references the files and one that has "allowed" the allowed table would store the hash and the link to the files table. When a user requests that hash it pulls it up and then you can have it delete after x minutes so then that hash is no longer valid to prevent hotlinking / people giving away the link. A simple random md5 or sha1 hash should suffice, just make sure to salt it up and randomize it with something like microtime. Quote Link to comment https://forums.phpfreaks.com/topic/215941-downloading-encrypted-files/#findComment-1122493 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.