How To Convert Physical Path to URL?

  • Thread starter Thread starter Jeffrey Walton
  • Start date Start date
J

Jeffrey Walton

Hi All,

Does ASP.Net offer any methods to convert physical paths to URLs? I've
seen some stuff on the web via blogs, but the examples look like a
kludge and I suspect there may be hidden security issues.

For example, Physical Path: 'D:\Download', Virtual Directory:
'download'

D:\Download\AAAA\aaaa.aspx ->
http:\\www.example.com\download\AAAA\aaaa.aspx

D:\Download\BBBB\bbbb.aspx ->
http:\\W.X.Y.Z\download\AAAA\aaaa.aspx

Thanks in advance,
Jeff
 
there is no builtin converter. the same physical dir may be mapped to
multiple urls (vdirs), even to mutilple servers.

with enough permission you can walk all the virs on the servers you are
interested in and look for a match.

-- bruce (sqlwork.com)
 
Usually this is the other way round. How do you get this physical path ? If
this is some kind of configuration it would be likely best to configure the
virtual path (and get the corresponding physical location) rather than to
configure the physical path and try to get a possible match by checking all
the site virtual paths...

--
Patrice


"Jeffrey Walton" <[email protected]> a écrit dans le message de groupe de
discussion :
(e-mail address removed)...
 
Back
Top