I can access the physical location of a server using Server.MapPath
. This gives me the physical path that is inside of wwwroot
folder.
I want to Save some data into the other drive of the same server say D:
drive. I think I can't get the physical location of D:
drive using Server.MapPath
because it is outside of the wwwroot
folder. So I will hardcoded this location into my project. But now the problem is I want to access the saved data using server url like www.mysite.com/image/myimage.png
where image/myimage.png
located in D:
drive. So I just want to know is it possible or not using asp.net or please suggest what should i do to overcome this problem
Ok, a couple things:
Don't hardcode your location, use appsettings in your web.config, that's what they are there for: http://msdn.microsoft.com/en-us/library/610xe886%28v=vs.100%29.aspx
You want to serve images from another drive. You need to set up a virtual directory in IIS under your website to achieve this: http://support.microsoft.com/kb/172138
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With