Jump to content

help for php download system. how can i make it?


novarahman001

Recommended Posts

Great!  As I said originally - we help with coding.  Show us the code you have a problem with and you'll surely get help with it.  Of course if you don't have any code, then I'd still call that a 'design problem'.

I see filehorse generating a link to a direct download with no expire.

http://www.filehorse.com/download-avast-antivirus/download/

 

There are other sites that do that though, basically setting a token in a url that can be used once or expire in a certain amount of time.

http://en.wikipedia.org/wiki/Tokenization_%28data_security%29

 

Sometimes their links are just their own custom versions of the hashed file locations or is an associated random token.

The download locations and hash values could be saved in a database.

Other methods such as sessions or cookies can be used as well with expires.

 

When a user clicks the link they are directed to a script which uses the hash or by using the token id will know the files location.

As well as the hash can also add timestamps for expiration times.

Can use mod_auth_token apache module

https://code.google.com/p/mod-auth-token/

 

This is very old, but has what you are looking for.

For your own good don't just use this exact code and run it.

Use it as a guide of how to go about it.

http://ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/

Instead of using $_SERVER['REMOTE_ADDR']

I would use...

$remote_ip = $_SERVER['REMOTE_ADDR'];
if (strstr($remote_ip, ', ')) {
    $ips = explode(', ', $remote_ip);
    $remote_ip = $ips[0];
} 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.