Serving only certain files from a directory to users on IIS7

iis-7symbolic-link

I'm have a need to show the most up to date version of a certain file in a directory to users who access a folder on my site (lets call this folder logs). I can't just move the file into the folder as another process relies on being able to find and edit this file while it is running.

At first I had thought I could just create a folder on my site, give it the correct permissions and then create a symbolic link to the file. However it seems IIS7 does not follow symlinks.

Another solution would be to create a phpscript that pulls the correct file and displays it, but that felt like over-engineering the solution.

I know that on Apache this would be simple, but I can't figure out how to do it with IIS7.

To give an idea of the folder structure I'm working with. The directory looks like this.

Root
–File I need to serve.
–File containing plain text passwords.
–Other folders/files.

I can't move any of these files. If I just serve the entire directory using Virtual Directories in IIS I'll also be sharing files and folders containing configuration and other sensitive information.

Best Answer

IIS won't follow windows shortcuts (right click new shortcut) i'm guessing this is what your calling a symlink their not the same as a symlink in linux. IIS will follow both synlinks and junctions in a NTFS file system

windows NTFS file systems do have symlinks but they can only be created using (depending on os) linkd or mklink commands

junctions or hardlinks can me made using junction which is part of the sysinternals toolkit

Related Topic