Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Calling a CFC in a subdirectory

New Here ,
Dec 08, 2009 Dec 08, 2009

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

515
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 08, 2009 Dec 08, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2009 Dec 08, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 09, 2009 Dec 09, 2009
LATEST

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources