PDA

Click to See Complete Forum and Search --> : Opposite of Server.MapPath


JoshT
Feb 1st, 2001, 08:55 AM
Given the physical path of a file, how would I get its virtual path from the web site?

Thanks,
Josh

Feb 1st, 2001, 03:38 PM
You would have to know the physical path of the webroot to know for sure.

The default for IIS is c:\inetpub\wwwroot, but it can be changed to any directory.

JoshT
Feb 2nd, 2001, 06:53 AM
Yeah, right now I'm stripping the "d:\inetpub\wwwroot" from the file name string and then replacing all "\"s with "/"s. I was hoping there was a more elegant, automatic way.

Thanks,
Josh