What's the opposite of Server.Map?
-
Here's what I need to do: Lets let I have a file located at "Z:\MyApp\myFile.txt" on the server. On my web form, I have a Hyperlink that I want to direct to (and open) this file. How do I obtain the virtual address for this file so that I can create the hyperlink? For instance, I can't just do file because the client computer doesnt know where Z: is. I need a way to map "Z:\MyApp\myFile.txt" to something like "http://www.mysite.com/myFile.txt" so that the link will be recognized. I think I saw some function that does this but I cant remember what it's called. Server.Map maps a virtual address to a physical address. I need to do the opposite. Can someone show me some light here?
-
Here's what I need to do: Lets let I have a file located at "Z:\MyApp\myFile.txt" on the server. On my web form, I have a Hyperlink that I want to direct to (and open) this file. How do I obtain the virtual address for this file so that I can create the hyperlink? For instance, I can't just do file because the client computer doesnt know where Z: is. I need a way to map "Z:\MyApp\myFile.txt" to something like "http://www.mysite.com/myFile.txt" so that the link will be recognized. I think I saw some function that does this but I cant remember what it's called. Server.Map maps a virtual address to a physical address. I need to do the opposite. Can someone show me some light here?
-
Here's what I need to do: Lets let I have a file located at "Z:\MyApp\myFile.txt" on the server. On my web form, I have a Hyperlink that I want to direct to (and open) this file. How do I obtain the virtual address for this file so that I can create the hyperlink? For instance, I can't just do file because the client computer doesnt know where Z: is. I need a way to map "Z:\MyApp\myFile.txt" to something like "http://www.mysite.com/myFile.txt" so that the link will be recognized. I think I saw some function that does this but I cant remember what it's called. Server.Map maps a virtual address to a physical address. I need to do the opposite. Can someone show me some light here?
Hi Inong, In ASP.NET, you can try HttpRuntime.AppDomainAppPath would give you the physical path of the application and then you can build the path. HttpRuntime.AppDomainAppVirtualPath which would give the virtual path (IIS Virtual directory) Deepak Kumar Vasudevan http://deepak.portland.co.uk/