Securing downloads

PythonPython Forum LeaderThe Royal RAM
Im working on something now and it lets users buy digital products which after payment they are given a link to download - which works fine...

But how can I protect the downloads?


Basically I want do have something like download.php?file=something

This when clicked then starts the download but without giving them the location of the file on the server. I also dont want the file extension to be within the url...

So basically how can I initiate a download in a PHP file

Thanks

The Royal Ram

Comments

  • CannonBallGuyCannonBallGuy Moderator Shared Hoster
    Cant "download.php" have lists of ifs...
    like:
    IF (file==something){then somehow download "something.extension"}
    elseIF (file==article){then somehow download "article0193.whatever"}
    elseIF (file==0800){then somehow download "number0800.haha"}

    and so on...
  • PythonPython Forum Leader The Royal RAM
    well it could... but i dont wanna sit there and type in an extra if statement each time i add a new download...

    The Royal Ram

  • CannonBallGuyCannonBallGuy Moderator Shared Hoster
    then can't you do something like:

    download "$file",".php"

    so that if its: download.php?file=something
    it downloads "something.php"...?
Sign In or Register to comment.