Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ISAPI and path of the web

Posted on 1998-11-10
10
Medium Priority
?
174 Views
Last Modified: 2013-12-25
I have an ISAPI extension, which, among other things, parses a HTML file and modifies it. My problem is the use of path in the template file.
I'm running on a NT server with IIS4. My ISAPI is located in the /SCRIPTS directory and my web is called /NEWS. The structure of /NEWS is something like this:
/
/Images
/Ads

In my HTML template file, image references is in the form images/picture.gif. The problem is that when the ISAPI has processed the file, /SCRIPTS is the default directory and since there is no /images directory underneath, no pictures are shown in the browser. The only solution I have found so far, is to make the image reference like /news/images/picture1.gif, but adding the webname to the template file won't do, as the file are copied to a number of other webs on the same server and I don't want to edit each file everytime I change something.
Isn't there some like "/root-of-current-web" tag I can use? I can't use / since I have a number of webs on the server and / returns the IIS root.

I'll up the points for a good solution..
0
Comment
Question by:BlackMan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
10 Comments
 
LVL 7

Author Comment

by:BlackMan
ID: 1829512
And by the way, I have the same problem with links...
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1829513
Have you tried /News/Images/whatever.gif?

Add the /News/ to the images/ path
0
 
LVL 7

Author Comment

by:BlackMan
ID: 1829514
Yes, but as I have a number of webs where this file is copied to at regular intervals, I don't want the web-name in the file ...
0
Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

 
LVL 10

Expert Comment

by:MasseyM
ID: 1829515
BlackMan, as I reread your question, you said that... Sorry.
0
 
LVL 7

Author Comment

by:BlackMan
ID: 1829516
That's allright, at least I got a response :-)
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1829517
Create a virtual directory underneath SCRIPT that points to the images directory. It doesn't matter that the directory is referenced more than once within the configuration.

Steve
0
 
LVL 7

Author Comment

by:BlackMan
ID: 1829518
That won't solve my problem, since each web must have it's own image-files as different users maintain them..
0
 
LVL 11

Accepted Solution

by:
mouatts earned 300 total points
ID: 1829519
If the script was executed from one of the pages withing /NEWS then you can use the environment variable HTTP_REFERER which gives the full url of the page from which your script, in this case, was executed. Thus you can strip down the file name and find the document directory.

If this is not the case then you could do the reverse of what I previously suggested and create a virtual directory under each web which pointed to your script directory and excute your script from there (ie /news/script) rather than from /script.

Steve
0
 
LVL 7

Author Comment

by:BlackMan
ID: 1829520
mouatts, I'm still evaluating your answer, I'll be back in a few days...
0
 
LVL 7

Author Comment

by:BlackMan
ID: 1829521
Your answer lead me to a solution, thanks!
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question