Get Calling Template Directory from CFC

Does anyone know how to get the directory path of the calling cfm file in a CFC?

If I use this statement to call a CFC from say this cfm file...  c:\websites\mysite\index.cfm

<cfset projects = CreateObject('Component','cfc.projects')>

The following code in the CFC file then tells me that the directory is "c:\websites\mysite\cfc\", but what I want is "c:\websites\mysite\".

<cfcomponent displayName="projects">
    <cfset this.rootdirectory = getfilefrompath(gettemplatepath())>
</cfcomponent>

Any suggestions?
goldentineAsked:
Who is Participating?
 
rob_lorentzConnect With a Mentor Commented:
I think you might have to caclulate that and pass it into the component then. I dont think there is away to get information about what/who called the component.
0
 
rob_lorentzCommented:

try looking at the http.path_info or http.path_translated variables.
0
 
goldentineAuthor Commented:
Those variables return the name of the template that the web browser is currently on, not the page that actually called the CFC...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.