Need to point to files outside the www root - iis

My problem is as follows, I am running a website on a window server. The websites are located in the following directory. 'c:/inetpub/wwwroot/'.
The c drive has become very full recently as one of the websites allows the user to upload files to this location 'c:/inetpub/wwwroot/mywebsite/recordings/'.
I would like to move this recordings folder the e drive on the server which has lots of space 'e:/mywebsite_data/recordings/'
I created this folder and have moved the files to there new location on the e drive.
My problem is I cannot create a hyper link to the files on this new location. I have tried this href below but obviously this is looking for a file on my own workstation.
Recording
Any suggestions?
Thanks

You can solve your problem by creating a virtual directory
Creating Virtual Directories in IIS 6.0
Here is an article on how to do this in IIS7
Understanding Sites, Applications, and Virtual Directories on IIS 7

You can use IIS' virtual directories: https://web.archive.org/web/20110318232846/http://support.microsoft.com/kb/172138
With them you can place external folders in your website (it's like an include).
Update:
Another tutorial: http://msdn.microsoft.com/en-us/library/zwk103ab.aspx

Related

Shared files & virtual directory persmissions on IIS

getting myself in a twist here, trying to set up a directory on one website to store a number of files that need to be accessed as include files by a number of other websites in the same server (IIS).
I've created the directory on the main website, and then virtual directories on the other websites, all with paths set to that.
www.mainsite.com/cdn/test.asp ... opens OK
www.othersite.con/cdn/test.asp ... opens the test file on the mainsite as well
But when I try to use an include (virtual or file) it can't find the test file.
Using FileSystemObject / DirectoryExists function can locate the main cdn folder, mapping the path from the virtual folders.
But it doesn't recognise the file in that folder?
Any ideas on making this work... or suggestions for a better way to do it would be much appreciated!
Thanks
Matt

Possible to use Virtual Path to an external disk on Plesk Managed Windows server?

After getting a helpful answer from this post I want to store media on a separate harddrive on the windows server. Is it possible to make those files available via http?
I soon discovered that Plesk does not allow me to create a virtual path that points to a location outside of my website root. I want the virtual path to point to a folder on D: (an extra disk, not the same as the website root directory)
Only two possible solutions I could think of, although I can't find them any where.
1) Maybe plesk has an advanced configuration file that prevents it from overwriting certain things in IIS when it runs its maintenance jobs or updates, specifically the Virtual Path I created directly in IIS outside of plesk.
2) Maybe there is a third party component available that offers this functionality, setting virtual paths outside of web root or the config file I just mentioned in #1.
Any other solutions are also welcome.
cd "%plesk_vhosts%\"domain.tld\httpdocs
mklink /J point c:\outOfSpace
Now provide permissions to "psacln" group to c:\outOfSpace and that's it.
Also you can create "point" not in httpdocs but in web space root and than from Plesk create Virtual Folder inside /httpdocs with needed access permissions.
There is issue that your custom permissions may lost after Plesk upgrade, this KB article describe how your can avoid it kb.sp.parallels.com/111194

How to setup IIS 7 using physical path directing to DropBox?

I'm using multiple computers for development and I want to be able to store my files in my dropbox folder. I went to change the physical path in IIS from c:\inetpup\wwwroot to the dropbox folder but I get this error:
The requested page cannot be accessed
because the related configuration data
for the page is invalid.
I couldn't find the config file so I was wondering if anyone had done this before or whether there a better way to sync everything nicely across several PCs?
I tried it (IIS 7.5, Win 7) and it should work just fine to let your physical path of your web look at your dropfox folder. I would guess your web.config file generally contains malformed XML (see KB942055).
I'd suggest, try to map it to an empty folder just with an index.html file and see if this error still occurs.
As a workaround, I guess you can put Dropbox in your wwwroot folder and set up a virtual directory that points to Dropbox. However, there are some security issues that may hinder you from doing so. I come across a nice tutorial on how to set up Dropbox to IIS as FTP Publishing. Hope it helps.
Hodgin's guide on using Dropbox as FTP publishing.

What is the difference between a shared folder and a virtual folder?

I am working with my friends on a web application hosted with IIS (Internet Information Service). I noticed that there're some so-called virtual folders in the IIS website tree view, and still some shared folders are used in our web application.
The virtual folders are like this:
http://myserver/folder1
The shared folders are like this:
\\myserver\folder2
So, what's the difference between them?
Many thanks.
Add - 1 -
And what's the difference between a web application and a virtual folder? I often right click on a virtual folder and turn it into a web application. But I just don't know what this action actually means?! Could anyone show me some material addressing in detail how a web application in IIS is invoked? I hope it could fit in the following chain.
a HTTP text request (GET, PUT, etc) arrives at IIS -> What happens here? -> a HTTP text response leave the IIS
Virtual folders are folders relatively to an URL path. It means that, as http://myserver is the root folder, you can map a physical folder on your disk drive into a folder that is virtually child of myserver wherever http://myserver is mapped to.
Shared folders are relative to the SMB protocol. The difference between HTTP and SMB is that with HTTP you can host a web application (ie. run code and generate HTML output) but with SMB you can only share files statically, ie. you can share executable files but they must be first downloaded and then executed.

IIS Config file in virtual directory

I have multiple websites that all have the same code, but different app settings.
I want to place my app settings in a separate configuration file that is located in a virtual directory. This will allow me to have a single copy of all of the code shared across all of the sites with a different virtual directory for each site.
Unfortunately, when I try to configure this, IIS doesn't process the config file when it is in a virtual directory.
If you have a solution to this, I would appreciate your help.
Maybe using the machine.config file on your web server would be a suitable alternative? Otherwise you could create a web.config file in a global folder somewhere and open it using the WebConfigurationManager.OpenMappedWebConfiguration() method.
It's not possible to use a virtual directory (or even files outside of the current website; only the current folder, or a sub-folder).
One possible way to share setting across projects would be to do it at build-time - either by coping it in, or using a Linked File in VS to have it copied to the folder on publish.
If you really need this functionality on the server, you could try (though I can't say how well it would work) a Junction.

Resources