Path to URL

S

Steven Burn

Oks, I know I'm going to seem completely stupid here but, I have a question
thats been doing my head in for the last few hours.

Basically, I'm trying to find a way to turn a folder and file path, from the
path, to the actual URL.

For example, if you were to type;

Response.Write <a href=" & folder.name & ">" & folder.name & "</a>"

It would automatically go to the URL of the folder, rather than the file,
but would display the link as the folder's name.

Doing it as;

Response.Write <a href=" & folder.name & ">" & folder.path & "</a>"

Will show the actual server path to the folder (i.e.
e:\myserver\myfolder\current_folder)

What I would like to do is have it so, instead of showing the folder's name,
or path, it would show the actual URL and not the server path, as the
folder.path does........

Hope I'm making sense here?.....

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
M

Mark Schupp

You'll have to build it from the URL to the web site containing the
directory that the file is in and the file name. There is no simple way to
map a file path to an HTTP URL even though you are sure that the file is in
a web site (not possible at all if the file is not in a web site).
 
S

Steven Burn

I'VE DONE IT!!!!........WOOHOO!

hehe, probably not the best way but, I've re-written one of the functions I
wrote for one of my VB app's, and it works....kinda

<%
strPath = " - http://" & request.servervariables("SERVER_NAME") &
StripABSPath(fl.Path)

Function StripABSPath(name)
Dim path
path = Split(name, "htdocs")
StripABSPath = path(UBound(path))
End Function

%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 

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
474,141
Messages
2,570,817
Members
47,365
Latest member
BurtonMeec

Latest Threads

Top