Sachin
Sachin

Reputation: 40970

How to access the location other than wwwroot in asp.net

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

Upvotes: 4

Views: 2424

Answers (2)

user2674996
user2674996

Reputation:

That is impossible or then it would be possible for any one to make script to upload files to any folder he wants. If you have access to the server consider making application to move your files.

Upvotes: 1

Mister Epic
Mister Epic

Reputation: 16733

Ok, a couple things:

Upvotes: 6

Related Questions