How To Convert Physical Path to URL?

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
 
B

bruce barker

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)
 
P

Patrice

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)...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top