Hey just want to hear if anyone know if you can like protect a folder where HTTP authentication is required then put files in there and when on a site someone E.g. pays to download something then the php document Auth's and downloads it and how secure would this be? :)

Thanks

angst

02-02-2010, 04:54 PM

yes, this can be done. lots of sites already do this. simply keep the files outside of the web root, then when some one pays for the download, stream the files to the client with a php function like this:
http://www.awesomephp.com/?Tutorials*16/Download-file-with-resume,-stream-and-speed-options.html

diload

02-02-2010, 05:07 PM

So basicly I can use info provided at http://php.net/manual/en/features.http-auth.php to authenticate and then call a function to download the file? :)

angst

02-02-2010, 05:10 PM

no, I wouldn't use that. if your selling downloads then you would want to auth them with php/mysql. once payment is complete, trigger the download.

diload

02-02-2010, 05:27 PM

Arh okay yea I get it :) got something working now so thank you very much :)