Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Remap the path in a ISAPI extension running at IIS

Posted on 1997-10-05
5
Medium Priority
?
542 Views
Last Modified: 2010-04-04
Hi,
I am writting a ISAPI extension, but how can I get the real path the a virtual directory. For example I send a path to the script /mydir/myfile.html. The I want to find where it is at the HD. Thanks!

(Sorry my bad english)
0
Comment
Question by:chrb
[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
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:buemoh
ID: 1346862
There are some usefull environment variables, like

PATH_INFO
PATH_TRANSLATED
DOCUMENT_ROOT
SCRIPT_NAME

Notice, it depends for which httpd server you are creating the ISAPI extension DLL, because not all server set all variables correct.

PWS sends always the WWW server document root, the real path, in the environment variable PATH_TRANSLATED.

0
 

Author Comment

by:chrb
ID: 1346863
The path i want to find out has nothing with the path to where the script is. The querystring may contain :
www.myserver.com/script/myscript?dir=/chr/guestbook
Then I want to find out the real path for /chr/guestbook, with PWS i have found out that i saves the homedir and virtuals path in the registry, dos IIS this.

(Sorry my bad english)

Chr
0
 
LVL 1

Expert Comment

by:buemoh
ID: 1346864
Why do you use this (?)

www.myserver.com/script/myscript/chr/guestbook

because the term /chr/guestbook is an extra path and  can be found in the PATH_INFO variable and then PATH_TRANSLATED gives you the correct "real" path on your server.

example:

www.myserver.com/scripts/test.dll/wwwroot/test.html

the variables have the following content
PATH_INFO = /wwwroot/test.html
PATH_TRANSLATED = c.\webshare\wwwroot\test.html

I think IIS stores also anything in the registry, but I don't know it exactly and you shouldn't use the registry to find out where your file is located!!

May be, this is what you need.


0
 
LVL 1

Accepted Solution

by:
buemoh earned 140 total points
ID: 1346865
Use an extra path, as I discripted in my las comment, like this

www.myserver.com/scripts/myscript.dll/chr/guestbook

then you'll find in the environment variables the following content

PATH_INFO = /chr/guestbook
PATH_TRANSLATED = drive:\path to the file\and the file itself

If you need more details, contact me - bye
0
 

Author Comment

by:chrb
ID: 1346866
Well, I want to know the real path to a directory, you can't do that with that. With that you show me you need a file.
Did you understand?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

715 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