So I need to make a customized CMS-type site (unfortunately, for someone) and I wanted to know if there is a way that I can prevent direct file access to, say, ZIP, JPG, DOC, etc, type files but have a PHP script be able to "get" them (probably by using a MySQL database with the filenames and a unique numerical ID to protect the location of the files). I'm aware of the HotLink protection offered by most sites, but basically I want a way that so that in a page, a link could be put in line this (to retrieve a file):
<a href="getfile.php?fileid=000000">Click here to get the file</a>
And whatever file links up with file ID 000000 would be placed somewhere on the site, in a folder such as: /cms/content/documents/test1.doc
Any ideas on how to do this? Basically, I want to prevent hotlinking and also prevent people from seeing where the content is stored (to prevent direct linking from other sites).