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

Link cfc file to subfolder

Guest
Sep 19, 2012 Sep 19, 2012

Having a problem linking my cfc file to a cfc file in another folder, for example. (goning to show it as i see it in DW)

One more thing i should add it that i am making this site on a local "test" machine (laptop).

Mywebsite

- cfc (Folder)

  - myCFC.cfc

- results (Folder)

  - index.cfm

   

That's pretty much it. Hope that clear enough.

I need to link the cfinvoke to the ( ../cfc/myCFC.cfc ). I tried (..cfc.myCFC), didn't work. Without the brackets of course.

940
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

correct answers 1 Correct answer

Guide , Sep 19, 2012 Sep 19, 2012

You didn't say that the Mywebsite folder was in the ColdFusion wwwroot (which is probably your webroot).  In that case, the path should be "Mywebsite.cfc.myCFC".  Remember that CFC paths are relative to the webroot.

Translate
Guide ,
Sep 19, 2012 Sep 19, 2012

I believe CFC paths in cfinvoke are relative to the webroot (unless you are using a mapping), so you should only need "cfc.myCFC" for it to work.

-Carl V.

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
Guest
Sep 19, 2012 Sep 19, 2012

I did that the first time around and got this error.

Could not find the ColdFusion component or interface cfc.complete.

Ensure that the name is correct and that the component or interface exists.


The error occurred in C:\ColdFusion9\wwwroot\Mywebsite\result\index.cfm: line 1


1. <cfinvoke component="cfc.myCFC" method="Search_Form" returnvariable="Result"/>

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
Guide ,
Sep 19, 2012 Sep 19, 2012

You didn't say that the Mywebsite folder was in the ColdFusion wwwroot (which is probably your webroot).  In that case, the path should be "Mywebsite.cfc.myCFC".  Remember that CFC paths are relative to the webroot.

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
Guest
Sep 19, 2012 Sep 19, 2012
LATEST

That was the ticket. Thanks for your replies. *Thumbs up*

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