I want to change download url into dynamic url (like Baidu Pan, Google Drive, ...) how to do?
Present: http://yourdomain/File/Download?action=download&path=/xxxxxxxxxxxx
Change into: http://yourdomain/f/dl/filehash/expires/dynamictoken
URL change is a rewrite of this URL: http://yourdomain/download.php?h=filehash&e=expires&t=dynamictoken
Parameters in the url:
"f/dl/" rewrite of "download.php", it's fake folder!
"h" = "filehash": Need to create this column, each file will have a different hash file, we get file information based on the hash file to get other information of the file (it's faster and safer).
"e" = "expires": Time allowed before URL is disabled. Can be used "time()*(60+15)" then url will expired after 15 minute.
"t" = "token": A random token is used to validate that this download URL is valid!
Of course, we must add the "filehash" column to the "sd_files" table and create a new "download" table. Then remove the old file download method and apply this new way will be more secure!
I haven't used the ThinkPHP Framework ever so I do not know how to rewrite the url, get data on the database,... So I can't change the current download link (because I don't know where is it and how is it?). But if you are interested in downloading safety as I mentioned above then please guide with comment on this topic or contact me through Facebook, QQ, Twitter with me.
It is interesting that I tried it for two hours and I made my account unlimited (you will need to make a small modification to the source code to get this).
Give you a photo~
I hope everyone will enjoy my initiative, and if you want to limit download speed, I can help you~