H
Harrie Verveer
is there a way to convert an absolute path
(C:\inetpub\wwwroot\project\folder\another_folder\file.jpg) to an url?
I used this code:
---
string sk = Server.MapPath(".").ToLower();
url_to_use = filename.ToLower().Replace(sk,".").Replace("\\","/");
---
My problem now is that the file resides in another project folder on the
server (please don't ask why
). The solution whould be to do something
like:
---
string sk = <path_of_wwwroot>
url_to_use = filename.ToLower().Replace(sk,"/").Replace("\\","/");
---
But I can't find a way to find the location of wwwroot - except for
MapPath(".."), which is not allowed
Anyone knows a solution?
(C:\inetpub\wwwroot\project\folder\another_folder\file.jpg) to an url?
I used this code:
---
string sk = Server.MapPath(".").ToLower();
url_to_use = filename.ToLower().Replace(sk,".").Replace("\\","/");
---
My problem now is that the file resides in another project folder on the
server (please don't ask why
like:
---
string sk = <path_of_wwwroot>
url_to_use = filename.ToLower().Replace(sk,"/").Replace("\\","/");
---
But I can't find a way to find the location of wwwroot - except for
MapPath(".."), which is not allowed
Anyone knows a solution?