You could have a database refer to all your downloadable contents, and have php serve the content, only giving away an ID instead of the url. So the url would be like download.php?fileID=12345
I'm not sure I remeber exactly how to do this but at least you need to call the header() function and tell the browser that it is to be interpreted as an image, then I believe you can use the function readfile(). So your download.php file should look something like this.
PHP Code:
<?php
$id = $_GET['fileID'];
// validate the id
// connect to database and retrieve actual url to file $file = "the url to your file, retreived from the database";
// Example of a pdf document // See the manual for all the different data types header('Content-type: application/pdf'); readfile($file);
?>
And you would call it as in
<a href="download.php?fileID=12345">Download PDF</a>
EDIT: I meant for hiding the files true urls. Can't help you with the .htaccess :P
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
Last edited by lizciz; 09-22-2009 at 04:07 PM..
|