Drupal 7 Secure File Download Script

Posted in Projects on Sep 26, 2011

This PHP script is designed to be integrated with a Drupal 7 instance, to serve predefined files to authenticated users only. To implement it, just place it somewhere in your DocRoot, then link from a node in your Drupal site to the script, setting the $_GET['file'] value to the required number for each request. It's an extremely simple script, and could be improved a lot, but there doesn't seem to be anything else like it around, so I hope it's of use to someone! Find the code here.