Creación de un enlace de descarga modificable

i have a program and need for update

and i have a question how can change download addresss for misconceive address by user.

well i need for change download address for update

for example i'm see very download link whit change address for example if click for download see this link :

http://www.site.com/0123abc45de/program.exe

and if again click for download see this link :

http://www.site.com/6789fgh98ij/program.exe

for create link like this how do i do ? how can create changeable link ?

preguntado el 08 de noviembre de 11 a las 14:11

1 Respuestas

¿Por qué quieres hacer esto?

Anyway you can create a kind of random token when a user requests a file. You then supply this token in an URI. You'd have to save them somewhere, for example in the session of the user.

With .htaccess you then create a rewrite rule, where you rewrite the url /{token}/{filename} a download.php?token={token}&filename={filename}.

Finally in the download.php you check if the requested $_GET['token'] equals the token you have in your session for that filename. If they match, the user may download the file.

respondido 08 nov., 11:18

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.