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

ASP Error 0126 include file not found, when using ".." in include file path

Hello,

I have some server side includes on a Classic asp page that look
something like:

<!-- #include virtual="/includes/file1.asp"-->
<!-- #include virtual="/includes/file2.asp" -->
<!-- #include virtual="/includes/file3.asp" -->
<!-- #include virtual="/includes/file4.asp" -->
<!-- #include virtual="/includes/file5.asp" -->
<!-- #include virtual="/includes/file6.asp" -->
<!-- #include virtual="/includes/file7.asp" -->
<!-- #include virtual="../includes/file8.asp" -->
<!-- include virtual="/_utils/file9.asp" -->

When we'd attempt to load the page it would give us a ASP Error 0126
include file not found error referring to ../includes/file8.asp.

I changed it to a /includes/file8.asp and the problem went away. I
don't really see what the advantage of having the .. in there, but we
have this type of syntax in a lot of other asp pages.

I can do a search and replace, but I'm wondering if there's some IIS
setting that will prevent the error from happening. I was thinking
that we should turn on directory browsing, but it was already on (this
is an internal test web site).

Could there be some kind of user permission issue? This is on a
freshly built from scratch test server. The web page hasn't really
changed much, not at all with regard to this include statement.

Thanks,
Eric

Jan 9 '07 #1
10 18816
Eric wrote on 09 jan 2007 in microsoft.public.inetserver.asp.general:
<!-- #include virtual="../includes/file8.asp" -->
IMHO:

virtual including starts from the web root,
so ../ would go below the root, which should be impossible,
given the normal settings of IIS.

I heard that IIS6 was more strict in this in it's default settings.

Second:
Is this directory permitted to be accessed by the ASP default user?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 9 '07 #2

"Eric" <er**********@gmail.comwrote in message
news:11*********************@i56g2000hsf.googlegro ups.com...
Hello,

I have some server side includes on a Classic asp page that look
something like:

<!-- #include virtual="/includes/file1.asp"-->
<!-- #include virtual="/includes/file2.asp" -->
<!-- #include virtual="/includes/file3.asp" -->
<!-- #include virtual="/includes/file4.asp" -->
<!-- #include virtual="/includes/file5.asp" -->
<!-- #include virtual="/includes/file6.asp" -->
<!-- #include virtual="/includes/file7.asp" -->
<!-- #include virtual="../includes/file8.asp" -->
<!-- include virtual="/_utils/file9.asp" -->

When we'd attempt to load the page it would give us a ASP Error 0126
include file not found error referring to ../includes/file8.asp.

I changed it to a /includes/file8.asp and the problem went away. I
don't really see what the advantage of having the .. in there, but we
have this type of syntax in a lot of other asp pages.

I can do a search and replace, but I'm wondering if there's some IIS
setting that will prevent the error from happening. I was thinking
that we should turn on directory browsing, but it was already on (this
is an internal test web site).

Could there be some kind of user permission issue? This is on a
freshly built from scratch test server. The web page hasn't really
changed much, not at all with regard to this include statement.
IIS 6?

By default parent paths are disabled. You can open the application
properties on home directory tab click click configuration. On the App
Options of the configuration dialog enable parent paths.

However for security reason you would be better of modifying your pages to
use an absolute path in this instance.

Thanks,
Eric

Jan 9 '07 #3

Anthony Jones wrote:
"Eric" <er**********@gmail.comwrote in message
news:11*********************@i56g2000hsf.googlegro ups.com...
Hello,

I have some server side includes on a Classic asp page that look
something like:

<!-- #include virtual="/includes/file1.asp"-->
<!-- #include virtual="/includes/file2.asp" -->
<!-- #include virtual="/includes/file3.asp" -->
<!-- #include virtual="/includes/file4.asp" -->
<!-- #include virtual="/includes/file5.asp" -->
<!-- #include virtual="/includes/file6.asp" -->
<!-- #include virtual="/includes/file7.asp" -->
<!-- #include virtual="../includes/file8.asp" -->
<!-- include virtual="/_utils/file9.asp" -->

When we'd attempt to load the page it would give us a ASP Error 0126
include file not found error referring to ../includes/file8.asp.

I changed it to a /includes/file8.asp and the problem went away. I
don't really see what the advantage of having the .. in there, but we
have this type of syntax in a lot of other asp pages.

I can do a search and replace, but I'm wondering if there's some IIS
setting that will prevent the error from happening. I was thinking
that we should turn on directory browsing, but it was already on (this
is an internal test web site).

Could there be some kind of user permission issue? This is on a
freshly built from scratch test server. The web page hasn't really
changed much, not at all with regard to this include statement.

IIS 6?

By default parent paths are disabled. You can open the application
properties on home directory tab click click configuration. On the App
Options of the configuration dialog enable parent paths.

However for security reason you would be better of modifying your pages to
use an absolute path in this instance.

Well I changed the .. on the server side includes to use an absolute
path and it fixed it. I did a some further investigation and it turned
out this was only done in 5 places in the app. However, we DID have
parent paths enabled. I wrote earlier that we had directory browsing
turned on, when I meant parent paths. We do this because we use parent
paths elsewhere in our application.

The web page that was calling the server side include with the ".."
wasn't in the root directory, so this should have been valid, in
theory.

Like I said, I can't see any good reason to use the parent paths in
this case. It would be great if someone could point me at some MS
documentation where they spell out what setting would make it possible
for this to with IIS 6, or at least confirming that they don't allow
this any longer.

Thanks,
Eric

Jan 10 '07 #4
Eric wrote:
>
Like I said, I can't see any good reason to use the parent paths in
this case. It would be great if someone could point me at some MS
documentation where they spell out what setting would make it possible
for this to with IIS 6, or at least confirming that they don't allow
this any longer.
Parent paths work fine on our IIS6 server after enabling them.

--
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.
Jan 10 '07 #5

Bob Barrows [MVP] wrote:
Eric wrote:

Like I said, I can't see any good reason to use the parent paths in
this case. It would be great if someone could point me at some MS
documentation where they spell out what setting would make it possible
for this to with IIS 6, or at least confirming that they don't allow
this any longer.
Parent paths work fine on our IIS6 server after enabling them.
On server side includes too?

Jan 10 '07 #6

"Eric" <er**********@gmail.comwrote in message
news:11**********************@77g2000hsv.googlegro ups.com...
>
Bob Barrows [MVP] wrote:
>Eric wrote:
>
Like I said, I can't see any good reason to use the parent paths in
this case. It would be great if someone could point me at some MS
documentation where they spell out what setting would make it possible
for this to with IIS 6, or at least confirming that they don't allow
this any longer.
Parent paths work fine on our IIS6 server after enabling them.

On server side includes too?
The parent-paths issue is only relevant to the server-side.

-
Mike Brind
Jan 10 '07 #7
Mike Brind wrote:
>>Parent paths work fine on our IIS6 server after enabling them.

On server side includes too?

The parent-paths issue is only relevant to the server-side.
Just a casual observation and a resulting question here. The term "include"
does seem the point of the question, not "server-side". So I am wondering --
are the things affected other than includes when parent paths are enabled?
Among the things that come to mind are Server.Execute() or Server.Transfer()
calls and paths to such things as .mdb files -- or the file system in
general.

Anyone know? I cannot find anything on MSDN but this:
http://msdn2.microsoft.com/en-us/library/ms524697.aspx, which does not
specify what is limited by a "path".

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Jan 10 '07 #8

Mike Brind wrote:
"Eric" <er**********@gmail.comwrote in message
news:11**********************@77g2000hsv.googlegro ups.com...

Bob Barrows [MVP] wrote:
Eric wrote:

Like I said, I can't see any good reason to use the parent paths in
this case. It would be great if someone could point me at some MS
documentation where they spell out what setting would make it possible
for this to with IIS 6, or at least confirming that they don't allow
this any longer.

Parent paths work fine on our IIS6 server after enabling them.
On server side includes too?

The parent-paths issue is only relevant to the server-side.

-
Mike Brind
Actually it wasn't the server side includes we were having problems
with, it was the virtual server side includes.

-Eric

Jan 10 '07 #9
Eric wrote:
Actually it wasn't the server side includes we were having problems
with, it was the virtual server side includes.
I don't think you can use .. in virtual="" paths. I don't remember that ever
being allowed.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Jan 10 '07 #10

"Dave Anderson" <NY**********@spammotel.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Mike Brind wrote:
>>>Parent paths work fine on our IIS6 server after enabling them.

On server side includes too?

The parent-paths issue is only relevant to the server-side.

Just a casual observation and a resulting question here. The term
"include" does seem the point of the question, not "server-side". So I am
wondering -- are the things affected other than includes when parent
paths are enabled? Among the things that come to mind are Server.Execute()
or Server.Transfer() calls and paths to such things as .mdb files -- or
the file system in general.

Anyone know? I cannot find anything on MSDN but this:
http://msdn2.microsoft.com/en-us/library/ms524697.aspx, which does not
specify what is limited by a "path".

Mappath is affected. It seems that Server.Execute and Server.Transfer makke
implicit use of Server.Mappath to resolve the file path, so they are
affected too. If you try Server.Execute("../somefile.asp") when parent
paths are disabled, the error message is "The '..' characters are not
allowed in the Path parameter for the MapPath method."

--
Mike Brind
Jan 11 '07 #11

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

Similar topics

2
by: | last post by:
We have Windows 2003 Server as our SUS server. When we try to approve updates, etc., we receive the following error message. Has anyone experiences this before? If so, can you tell us what...
3
by: masonj | last post by:
For no apparent reason, my webpage cannot be brought up due to an internal server error. My host tells me an asp 0126 error occurred because an include file is missing. Its there. I've also...
0
by: Adil Akram | last post by:
I'm using IIS 5.0 Win2K (SP3). IIS sometime reports ASP 0126 "Include file not found" error on several .asp pages. 've checked my ASP coding its alright and works lot of time but some time it...
1
by: Des Perado | last post by:
We have an elderly DOS-based system running on a Novell Netware server here, and an extensive intranet. Quite recently the board decided that some crucial info from the DOS system was to be made...
0
by: DY1 | last post by:
I have this message appearing on the webpage I intend to visit: ________________________________________________________ Active Server Pages error 'ASP 0126' Include file not found ...
0
by: Eric | last post by:
Hello, I tried to post this a few minutes ago, but never saw it show up, hopefully this won't be a double-post. I have some server side includes on a Classic asp page that look something...
5
by: chris_peoples | last post by:
I have a virtual directory, lets say it exists at www.server-a.com/virtual-dir/ virtual-dir points to another directory on another server using the unc path: \\server-b\main-dir I have a file at...
2
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.