Download a File Outside of Web Directory I have a scenario where certain files are stored outside of the Document Root directory, like this...

/home/user/public_html/{drupal files are in here}
/home/user/data/{special data files are in here}


I would like to allow users with special permissions to download files from /home/user/data using Drupal's built-in file wrapper, but I'm not sure how to link to the files.

Addendum: Most of my files are stored in the usual location:

/home/user/public_html/sites/default/files


It is only some of them I need to store in the external data folder. For security reasons I do not want to change the sites/default/files/ directory to /home/user/data.
Drupal 6 doesn't support having both private and public files enabled, but there are some modules that provide this, for example http://drupal.org/project/private_download.

If that modules doesn't do what you need, you can also write your own, see file_download() for inspiration. This is the page callback that serves private files through PHP by checking access with hook_file_download().