If you run a site that has tons of files for your users to download (or even just a few) that you want to keep safe from a direct link, this new article from the O'Reilly PHP DevCenter might be just what you're looking for.
One of the hallmarks of a well-developed web presence is the ability to offer downloads. We're all familiar with the site that offers you a free application. You receive something of value in exchange for supplying the site with a contact name and email address. This isn't the only example: remote code compilation, translation services, and forum requests are others.
This article demonstrates how to create a web site that offers a binary download in exchange for user-supplied information in a manner that protects your data. The site will store information gleaned from a form on the site as well as the downloadable binary in a PostgreSQL database.
While I'm not a big proponent of storing binary data in a database, I suppose in this case, it does make things easier. They give you all the code and database structures so that you can simply cut and paste your way into the functionality.




