473,287 Members | 1,501 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,287 software developers and data experts.

Site absolute paths?

I have a need for a site-absolute path specifier (server side).

My issue is that I have pages w/ graphics in the banners (whee!), but the pages
are at different levels of the folder hierarchy. Lastly, the entire site may
or may *not* be at the website root, it all depends on how it was installed.

So, to reference the graphics, I need a way to specify the location of the
graphic in a way that doesn't break.

Something like:

../images/pic1.jpg

obviously doesn't work if the page is a folder or two lower, and

/images/pic1.jpg

doesn't work if the site is installed in a sub-folder on the web server.

Is there some server-side tag that I can use in the path that will work like:

{site-root}/images/pic1.jpg

so that regardless of where the referencing page is located in the hierarchy
and regardless of where the site is installed, it will work???

Thanks
Nov 18 '05 #1
2 1228
using the tilde ~ character might be just what you need..

here's an article about it..

http://www.awprofessional.com/articl...01145&seqNum=2
Nov 18 '05 #2
Julie wrote:

I have a need for a site-absolute path specifier (server side).

My issue is that I have pages w/ graphics in the banners (whee!), but the pages
are at different levels of the folder hierarchy. Lastly, the entire site may
or may *not* be at the website root, it all depends on how it was installed.

So, to reference the graphics, I need a way to specify the location of the
graphic in a way that doesn't break.

Something like:

../images/pic1.jpg

obviously doesn't work if the page is a folder or two lower, and

/images/pic1.jpg

doesn't work if the site is installed in a sub-folder on the web server.

Is there some server-side tag that I can use in the path that will work like:

{site-root}/images/pic1.jpg

so that regardless of where the referencing page is located in the hierarchy
and regardless of where the site is installed, it will work???

Thanks


I guess I'm the only one that has ever had this problem? Regardless, I've
found a solution using the Application object:

ImageUrl = Application["AppPath"] + "/images/pic1.jpg"
Nov 18 '05 #3

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

Similar topics

6
by: David Siroky | last post by:
Hi! When I "compile" my python files with "python -OO ...." into pyo files then they still contain absolute paths of the source files which is undesirable for me. How can I deal with that? ...
2
by: engwar1 | last post by:
I'm a .NET newbie and am beginning the process of converting an existing personal website to .NET from classic ASP. I'm assuming I want my aspx files in the root of my site in the same place as...
7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
0
by: Jason Lawrence | last post by:
I have an attributed ATL project (call it B) that I am building with Microsoft Visual C++ .NET (55537-640-3684941- 18356). In the project I include the COM generated file A.h (from another ATL...
0
by: Chris Gill | last post by:
I'm trying to use cookieless sessions in asp.net using the InProc mode (for various reasons it is not desirable for us to use the other modes if it is possible to avoid them). My problem revolves...
3
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin...
19
by: Jerry M. Gartner | last post by:
Greetings: What is the best way to resolve paths within a document regardless of what path it is opened under? For example: I have x.php and it contains <img src="images...">, (amongst other...
6
by: MaiyaHolliday | last post by:
Hello, I've recently installed apache on a new computer, and cannot figure out why my site will not process any includes. (it was working on my old one) There are no errors on the page such as...
3
by: buzz2050 | last post by:
Hi all, I am using cURL for the first time. I need to login to a site and my cURL code to do the same is as follows: //curlScript.php <?php function getContent($url, $referer,...
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
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.