473,216 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

Path to URL

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)

Jul 19 '05 #1
2 4679
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).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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)

Jul 19 '05 #2
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)
Mark Schupp <ms*****@ielearning.com> wrote in message
news:O2**************@TK2MSFTNGP11.phx.gbl...
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).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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)


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
9
by: Bengt dePaulis | last post by:
I have a local directory that I want to include in my sys.path How to save it permanently? Regards /Bengt
70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
2
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure...
4
by: python | last post by:
Bad file names, i.e. filenames the OS considers illegal, will cause functions in the os.path module to raise an error. Example: import os.path print os.path.getsize( 'c:/pytest/*.py' ) On...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
8
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
6
by: bukzor | last post by:
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname,...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.