Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sunday, November 27, 2011 4:30 PM
Hi,
I am new to IIS server. I did the basic configuration for my asp.net application.
I would like to setup IIS to server static files. Could one please let me know how can i do that.
Thanks
Mohan
Wednesday, November 30, 2011 2:35 AM ✅Answered
Hi,
So could you please let me know how to configure IIS directly server the file instead of handing over request to app the following link http://localhost/docs/2011/test.pdf respective doc is located at d:\corp\docs\2011\test.pdf
You can create a virtual directory under the default web site(listening port 80), specify its physical path as " d:\corp". Please make sure the IIS_IUSRS has permissions on the folder.
How to: Create and Configure Virtual Directories in IIS 7.0
http://msdn.microsoft.com/en-us/library/bb763173.aspx
If I misunderstood you, please don't hesitate to let me know. Thanks.<!>
Sunday, November 27, 2011 9:47 PM
Make sure the Static File module is installed and you are all set, which I think this module is installed by default. Try serving a html, css, js file to see.
Monday, November 28, 2011 1:41 AM
hi mohan, as far as I am concerned, you do not have to do anything to serve static file. When you install IIS on your system, by default, it has server static file, such as .html and .htm. If you need your IIS to serve other file extension, such as .aspx, you then need to have ASP.NET Framework installed
Monday, November 28, 2011 3:02 AM
Hi Steve,
Thank you for your reply.
I verified Static File module is installed in IIS.
I believe i did not ask my question correctly.
Actually we have pdf files to be served by our asp.net app when user clicks a link.
So i am thinking like configuring IIS to directly server those file instead of burdening my app to open it thorugh streamreader and then writing to browser.
As those documents are located in some other location than my application.
example: my app codes are in c:\inetpub\wwwroot\myapp\
but the pdf files to be server are in another drive (at present they are in local drive in future they may be moved to network shared drive) d:\corp\docs\
So could you please let me know how to configure IIS directly server the file instead of handing over request to app the following link http://localhost/docs/2011/test.pdf respective doc is located at d:\corp\docs\2011\test.pdf
Thanks in advance.
Best Regards,
Mohan