...

View Full Version : #INCLUDEing an absolute pathname??



Composer
08-18-2002, 11:37 PM
I feel like a boob, but how do I get a number of websites on a single server to share a common library of asp files? I've tried every variation on #INCLUDE I can find reference to, but to no avail.

What I'd most like to be able to do is simply #INCLUDE an actual disk pathname, e.g.:


<!-- #INCLUDE FILE = "C:\MyASPLib\includethis.asp" -->

But this always gives me the error that the file cannot be found, even though I can confirm that the path is correct.

Is anything like this possible?

thanks.

Jeff

Roy Sinclair
08-19-2002, 06:25 AM
Put the "common" library of include files into a directory under the root and name it something like "includes". Then use <!--#include virtual="/includes/NameOfFileGoesHere"-->.

You also must turn on the "Enable Parent Paths" option in the cofiguration for the ASP application.

Composer
08-19-2002, 02:07 PM
Your suggestion of course works for a single website -- but the others, which reside in other directories on the drive, cannot access the files in this way.

Is there really no way to do this ??

Roy Sinclair
08-19-2002, 02:42 PM
Originally posted by Composer
Your suggestion of course works for a single website -- but the others, which reside in other directories on the drive, cannot access the files in this way.

Is there really no way to do this ??

I see I didn't quite understand your original question but there is indeed a simple answer:

Set up a virtual directory on each of the web sites that point to the single location for your include files. Using the virtual path in your include statements, the files will be found (I know that'll work because I'm doing exactly that on a server I manage).

Composer
08-19-2002, 03:00 PM
Thanks Roy -- that's what I was looking for!

semsem
05-13-2005, 10:05 PM
i've a site working on windows 2003, u know that u've to work with the virtual path, it's works well on windows2003, but it doesn't at windows xp that i work on at home, i remove the parental path put it still doesnt work

any body help

Okiyah
05-16-2005, 09:47 PM
You also must turn on the "Enable Parent Paths" option in the cofiguration for the ASP application.

Hmm that's why I'm getting

"The Include file '..\includes\connexion_bd.asp' cannot contain '..' to indicate the parent directory. "

What do you mean by configuration of the ASP application ('cause I don't think, I have the right on this here and I would like to indicate to the administrator where to change this) ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum