PHP protected file downloads for your site’s members

You may also like...

  • Adi

    You could also use cookies or server side tracking of IP’s to make sure nobody downloads more than X files at once. Some kind of semaphore with X slots.

  • What’s wrong with http authentication?

  • How does the entire file ends up in memory?
    I did, about 4 years ago, a PHP script that would check credentials and then read from the file and write to the user, copy&paste via a small buffer. Why load the entire file in memory?
    Use readfile ( )… or any of the other alternatives listed on that page.

  • P.S. You need to set the buffer/chuck size or just rought it out with fopen and friends.