Linking to files in filesystem
antilog - April 5, 2009 - 06:30
I am probably missing something obvious here, but I am trying to figure out the easiest way to link to a file or directory from a drupal page to my filesystem. I am trying to make digital archives available to artists, and the files reside on a share that I've mounted on the webserver. Just drawing a blank on how to link to those files on a drupal page.
Any ideas?
Thanks

Create Symbolic Link
If I understand what you're asking, you have a directory on your server that sits outside of your drupal folder. I'm going to use example names.
/www/example.com (your drupal folder)
/usr/me/bunch_o_files (your file folder)
/www/example.com/sites/default/files (drupal's file directory for images, download-ables and uploaded files)
On your server, command line:
$ ln -s /usr/me/bunch_o_files /www/example.com/sites/default/files/my_images
That creates a 'soft link' so that when you list the contents of the latter, you are actually seeing the contents of the former. Drupal will see this new link as an actual subdirectory of sites/default/files.
Also look at 'mount --bind' command which mounts another filesystem, but I don't think that's necessary.
Now, you have to make sure your web server sees this as well, and that the drupal user account has permissions to see this. But this is the general idea, I believe. I am not expert on this, so maybe someone else can offer better solution.