I only want the zip file to be available once after a user purchases it, and it can only be downloaded once
The file is outside public_html, it isn't publicly available, but I can't figure how to send the file to the browser.
Using this guide: Idiot-proof, cross-browser force download in PHP how can I get it to work with non-public access to the zip file? I tried setting the path to the file, but it didn't work. (I tested it with a browser accessible path and it did work)
As for the other concern, only allowing it to be downloaded once, I am doing the following:
- user accesses the unique download page
- checks to see if the product was already downloaded
- updates mySQL saying that it has been downloaded
- send headers to download the file