Skip to main content
Participant
December 9, 2009
Question

Calling a CFC in a subdirectory

  • December 9, 2009
  • 1 reply
  • 538 views

I'm trying to figure out how to use cfinvoke to call a cfc sitting in a subdirectory...

It's apache with userdir turned on (so each user that has a public_html directory in their homedir can have a site)

The resulting logical path looks something like this:

/~user/CFC/component.cfc

/~user/test.cfm

I don't know what to put in test.cfm for it to see component cfc... Usually we would have the CFC directory in document root, so I would just be able to put <cfinvoke component='cfc.component'> but that's not the case now...

Thanks

    This topic has been closed for replies.

    1 reply

    Inspiring
    December 9, 2009

    if /~user is effectively the web root for each user, then /CFC/component.cfc should work.

    If not, try relative addresssing - ../CFC/component.cfc

    Participant
    December 9, 2009

    Thanks for the response. Web root is still /. Each user just gets a subdirectory off web root when UserDir is enabled, so /CFC did not work... Neither did ../CFC/ unfortunately, not even ./CFC/

    The only way I can make it work is if I put the .cfc in the same dir as the script, which is OK for now but will not be practical once I have a whole list of them.

    Inspiring
    December 9, 2009

    Your OP is clearer in the light of day.  For you specific example, CFC/component.cfc should work.  For your long term plan, is it your intent for users to share cfc's?