Ask a Question related to ASP Components, Design and Development.
-
Eranga Udesh #1
Howto get the current file path with SSI
Hi All,
In my ASP file, located at the "/test" directory of the website, I include
another ASP file as below.
<!--#include file="../templates/_header.asp"-->
Inside the _header.asp file, how can I get the current file (_header.asp)
directory? I need to get the web relative/absolute directory of _header.asp,
but instead even if I can get the physical directory location of that file
should be fine.
I tried Request.ServerVariables("") with almost all the variables, but none
gave me what I wanted. This is necessory, becase the location of _header.asp
and the file which includes that can vary.
Please give me a help/clue as soon as possible.
Thanks in advance!
Eranga
Eranga Udesh Guest
-
Library path relative to current .rb file
One of the most irritating (missing) features of Ruby is inability to 'require' files in the same directory or subdirectories as the executing... -
How to get the full path of the current open PDF file?
How to get the full path of the current open PDF file from PDDOC or AVDOC?? Thanks!! -
#25444 [Bgs->Opn]: php4isapi.dll path to win.ini doesn't load from current path.
ID: 25444 User updated by: ict at primus dot ca Reported By: ict at primus dot ca -Status: Bogus +Status: ... -
#25444 [Opn->Bgs]: php4isapi.dll path to win.ini doesn't load from current path.
ID: 25444 Updated by: sniper@php.net Reported By: ict at primus dot ca -Status: Open +Status: Bogus... -
#25444 [NEW]: php4isapi.dll path to win.ini doesn't load from current path.
From: ict at primus dot ca Operating system: W2K PHP version: 4.3.3 PHP Bug Type: *Configuration Issues Bug description: ... -
Surjit Madiwalar #2
Re: Howto get the current file path with SSI
Hi
Try this
Server.MapPath(Request.ServerVariables("SCRIPT_NAM E"))
or this
Request.ServerVariables("PATH_TRANSLATED")
Let me know if this helped u...
Rgds
Surjit
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Surjit Madiwalar Guest
-
Aaron Bertrand [MVP] #3
Re: Howto get the current file path with SSI
You can't, since the ASP code inside the include file thinks it is being
executed from the file calling it. One thing you might consider is
declaring a variable in the parent file, and referencing it in the #include
file.
<%
scr = request.servervariables("SCRIPT_NAME")
includedPath = left(scr,instrRev(scr,"/")-1) & "/templates/_header.asp"
%>
<!--#include file="../templates/_header.asp"-->
(Then reference the includedPath variable within the include file.)
Next time, please take a look at your cross-post list. This has nothing to
do with databases or components, and certainly has nothing to do with
ASP.NET. Followups set to asp.general ONLY.
"Eranga Udesh" <eranga@omnibis.com> wrote in message
news:%23e6vsqrGEHA.1720@tk2msftngp13.phx.gbl..._header.asp,> Hi All,
>
> In my ASP file, located at the "/test" directory of the website, I include
> another ASP file as below.
>
> <!--#include file="../templates/_header.asp"-->
>
> Inside the _header.asp file, how can I get the current file (_header.asp)
> directory? I need to get the web relative/absolute directory ofnone> but instead even if I can get the physical directory location of that file
> should be fine.
>
> I tried Request.ServerVariables("") with almost all the variables, but_header.asp> gave me what I wanted. This is necessory, becase the location of> and the file which includes that can vary.
>
> Please give me a help/clue as soon as possible.
>
> Thanks in advance!
> Eranga
>
>
Aaron Bertrand [MVP] Guest
-
Aaron Bertrand [MVP] #4
Re: Howto get the current file path with SSI
You can't, since the ASP code inside the include file thinks it is being
executed from the file calling it. One thing you might consider is
declaring a variable in the parent file, and referencing it in the #include
file.
<%
scr = request.servervariables("SCRIPT_NAME")
includedPath = left(scr,instrRev(scr,"/")-1) & "/templates/_header.asp"
%>
<!--#include file="../templates/_header.asp"-->
(Then reference the includedPath variable within the include file.)
Next time, please take a look at your cross-post list. This has nothing to
do with databases or components, and certainly has nothing to do with
ASP.NET. Followups set to asp.general ONLY.
"Eranga Udesh" <eranga@omnibis.com> wrote in message
news:%23e6vsqrGEHA.1720@tk2msftngp13.phx.gbl..._header.asp,> Hi All,
>
> In my ASP file, located at the "/test" directory of the website, I include
> another ASP file as below.
>
> <!--#include file="../templates/_header.asp"-->
>
> Inside the _header.asp file, how can I get the current file (_header.asp)
> directory? I need to get the web relative/absolute directory ofnone> but instead even if I can get the physical directory location of that file
> should be fine.
>
> I tried Request.ServerVariables("") with almost all the variables, but_header.asp> gave me what I wanted. This is necessory, becase the location of> and the file which includes that can vary.
>
> Please give me a help/clue as soon as possible.
>
> Thanks in advance!
> Eranga
>
>
Aaron Bertrand [MVP] Guest



Reply With Quote

