Oh and placing a directory outside a virtual directory is not an option.
Putting the directory outside the virtual directory is the only solution I have found (so far). What you can do is create a link (connection) in the file system so that the directory is inside the virtual directory, for example:
- Our website (virtual directory) is located at C: \ projectX \ website
- the data directory (where we create / delete files and folders) is located in the C: \ projectX \ data li> directory
- then we create a link that makes the data folder accessible as C: \ projectX \ website \ data li>
The link is created using the Linkd.exe program (available in the Windows Resource Kit) with the following command:
linkd c:\projectX\website\data c:\projectX\data
Now c: \ projectX \ website \ data is a link / connection that points to a real data directory. You can work with the link as if it were a physical directory.
eg. on your website you can access it using this code:
Server.MapPath("~/data")
And you can also use the Windows file explorer and browse C: \ projectX \ website \ data. It looks like a real directory.
source share