Extra Path Info

C

cdkorzen

I'm sorry if this is a rehash, but all I see is the same info.

Here's my debacle:

I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python, Perl,
Cmd files... works fine. ASP can't find a file when extra path
information is added. Is there a switch in ASP or something I can
change that'll get it to work?

Thanks!
 
B

Bob Barrows [MVP]

I'm sorry if this is a rehash, but all I see is the same info.

Here's my debacle:

I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python,
Perl, Cmd files... works fine. ASP can't find a file when extra path
information is added. Is there a switch in ASP or something I can
change that'll get it to work?

Thanks!
1. What scripting language are you talking about?
2. I can't understand your pr9oblem. Please provide a simple example to
illustrate it.
 
C

cdkorzen

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.
 
B

Bob Barrows [MVP]

ASP has no concept of "extra path info", unless you are talking about
querystrings. In IIS, the only thing allowed after the file name is a
list of name/value pairs initiated with a question mark and delimited
with &'s:

http://www.myweb.com/path/abc.asp?a=526&b=hello

This name/value pair list is called a querystring. Is that what you are
talking about? I'm really not familiar with Python.

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.
1. What scripting language are you talking about?
2. I can't understand your pr9oblem. Please provide a simple example
to illustrate it.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.
 
B

Bob Barrows [MVP]

PS. You can find the ASP scripting documentation here:
http://msdn.microsoft.com/library/en-us/iissdk/html/2c40c3cf-90eb-41ca-ae2a-0ef33a651779.asp

Click around in the TOC to find the IIS docs

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.
1. What scripting language are you talking about?
2. I can't understand your pr9oblem. Please provide a simple example
to illustrate it.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.
 
S

Slim

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.

nope, still dont know what you mean. But

maybe this line may clear things up

<%= Server.MapPath( Request.ServerVariables("PATH_INFO")) & "?" &
Request.ServerVariables("QUERY_STRING") %>


or this one

http:// <%=Request.ServerVariables("LOCAL_ADDR") &
Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING") %>
 
C

cdkorzen

I take issue with your assertion that in IIS, the only thing allowed
after the filename is the query string. It definitely will allow such
data, as evidenced by the Python code. Also, look for servers that use
it, as an example:

http://<someserver>/news/data.dll/articles/1304?printview=true

I don't know if something exactly like that exists, but I've seen
similar... the extra path information is used to make the site
search-engine friendly, since search engines usually ignore query
strings.

The Python code is acting similar to a CGI, and in the Application
settings I have the set up the mapping, so that the Python interpreter
is called and acts similar to a CGI program, as far as I understand.

All the Python code does is print out the "PATH_INFO" environment
variable. It's
Bob said:
ASP has no concept of "extra path info", unless you are talking about
querystrings. In IIS, the only thing allowed after the file name is a
list of name/value pairs initiated with a question mark and delimited
with &'s:

http://www.myweb.com/path/abc.asp?a=526&b=hello

This name/value pair list is called a querystring. Is that what you are
talking about? I'm really not familiar with Python.

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.
(e-mail address removed) wrote:
I'm sorry if this is a rehash, but all I see is the same info.

Here's my debacle:

I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python,
Perl, Cmd files... works fine. ASP can't find a file when extra
path information is added. Is there a switch in ASP or something I
can change that'll get it to work?

Thanks!
1. What scripting language are you talking about?
2. I can't understand your pr9oblem. Please provide a simple example
to illustrate it.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 
B

Bob Barrows [MVP]

Ah! I did not realize you were talking about browsing to a dll (note
that I used a .asp file in my example)!

Someone else will need to step in on this. I have no experience in this
area.

I take issue with your assertion that in IIS, the only thing allowed
after the filename is the query string. It definitely will allow such
data, as evidenced by the Python code. Also, look for servers that
use it, as an example:

http://<someserver>/news/data.dll/articles/1304?printview=true

I don't know if something exactly like that exists, but I've seen
similar... the extra path information is used to make the site
search-engine friendly, since search engines usually ignore query
strings.

The Python code is acting similar to a CGI, and in the Application
settings I have the set up the mapping, so that the Python interpreter
is called and acts similar to a CGI program, as far as I understand.

All the Python code does is print out the "PATH_INFO" environment
variable. It's
Bob said:
ASP has no concept of "extra path info", unless you are talking about
querystrings. In IIS, the only thing allowed after the file name is a
list of name/value pairs initiated with a question mark and delimited
with &'s:

http://www.myweb.com/path/abc.asp?a=526&b=hello

This name/value pair list is called a querystring. Is that what you
are talking about? I'm really not familiar with Python.

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make
sure this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.

Bob Barrows [MVP] wrote:
(e-mail address removed) wrote:
I'm sorry if this is a rehash, but all I see is the same info.

Here's my debacle:

I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python,
Perl, Cmd files... works fine. ASP can't find a file when extra
path information is added. Is there a switch in ASP or something
I can change that'll get it to work?

Thanks!
1. What scripting language are you talking about?
2. I can't understand your pr9oblem. Please provide a simple
example to illustrate it.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will
get a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.
 
C

cdkorzen

Let me make it even more clear:

Create an ASP.NET web application with C#

Add a label to the page

Add this code to the Page_Load event:
==================================
Label1.Text = Request.PathInfo;
==================================

Now, browse to the page like normal. Nothing appears.

Go to the page, but after typing the name of the page /<filename>.aspx,
type in /test so it looks like /<filename>.aspx/test

The label will say /test

THAT is the effect I'm trying to achieve, but with ASP. I'm hoping to
do a prototype with ASP to get the UI and an idea of the flow, then
move to something like CGI, ASP.NET or ISAPI.


I take issue with your assertion that in IIS, the only thing allowed
after the filename is the query string. It definitely will allow such
data, as evidenced by the Python code. Also, look for servers that use
it, as an example:

http://<someserver>/news/data.dll/articles/1304?printview=true

I don't know if something exactly like that exists, but I've seen
similar... the extra path information is used to make the site
search-engine friendly, since search engines usually ignore query
strings.

The Python code is acting similar to a CGI, and in the Application
settings I have the set up the mapping, so that the Python interpreter
is called and acts similar to a CGI program, as far as I understand.

All the Python code does is print out the "PATH_INFO" environment
variable. It's
Bob said:
ASP has no concept of "extra path info", unless you are talking about
querystrings. In IIS, the only thing allowed after the file name is a
list of name/value pairs initiated with a question mark and delimited
with &'s:

http://www.myweb.com/path/abc.asp?a=526&b=hello

This name/value pair list is called a querystring. Is that what you are
talking about? I'm really not familiar with Python.

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.

Bob Barrows [MVP] wrote:
(e-mail address removed) wrote:
I'm sorry if this is a rehash, but all I see is the same info.

Here's my debacle:

I CAN get the PATH_INFO to work. With ANYTHING but ASP. Python,
Perl, Cmd files... works fine. ASP can't find a file when extra
path information is added. Is there a switch in ASP or something I
can change that'll get it to work?

Thanks!
1. What scripting language are you talking about?
2. I can't understand your pr9oblem. Please provide a simple example
to illustrate it.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 
B

Bob Barrows [MVP]

Let me make it even more clear:

Create an ASP.NET web application with C#

Add a label to the page

Add this code to the Page_Load event:
==================================
Label1.Text = Request.PathInfo;
==================================

Now, browse to the page like normal. Nothing appears.

Go to the page, but after typing the name of the page
/<filename>.aspx, type in /test so it looks like /<filename>.aspx/test

The label will say /test

THAT is the effect I'm trying to achieve, but with ASP. I'm hoping to
do a prototype with ASP to get the UI and an idea of the flow, then
move to something like CGI, ASP.NET or ISAPI.
I know of no way to accomplish what you are after using a .asp file.
 
C

cdkorzen

Okay thanks. That was what I was going after.

I know of no way to accomplish what you are after using a .asp file.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 
A

Anthony Jones

Sorry it's not too clear.

Here's my issue: I'm using VBScript in ASP, and Python to create a
CGI.

Python Code:
=============================================
import os

print "Content-type: text/plain\n"

print "Path info:", os.environ["PATH_INFO"]
=============================================

ASP:
=============================================
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
<TITLE>Path Info Test</TITLE>
</HEAD>
<body>
The extra path information is: <%=
Request.ServerVariables("PATH_INFO") %>
</body>
</HTML>
=============================================


My issue is, when I call them as:
http://<my server>/<path>/<filename>
both scripts return the PATH_INFO as /<path>/<filename>

When I call them as:
http://<my server>/<path>/<filename>/<extra>/<path>
the Python script returns a PATH_INFO of
/<path>/<filename>/<extra>/<path>
and the server reports that the ASP file cannot be found.

I have made sure that in the application settings, "Check to make sure
this file exists" is disabled.

So, my question is why do the two scripts react differently to added
path information? My initial guess was that the Python script calls
the EXE and runs like a CGI but the ASP runs as an ISAPI, but that
didn't make much sense to me.

Hope this clarifies my question.

A clunky way to do this is to make the page the 404 custom error handler for
itself.
However the extra info would need to be found from the QUERY_STRING server
variable instead. One problem might be that relative paths won't work well
like this.

A slightly less clunky way is to drop the .asp from filename and make a
folder with the filename. Now add the file as a custom 404 handler for that
folder. The URL paths are preserved from the browsers point of view so
relative paths will work. You still need to parse out of the QUERY_STRING
the info you need.
 

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

Staff online

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top