Skip to main content
September 19, 2012
Answered

Link cfc file to subfolder

  • September 19, 2012
  • 1 reply
  • 975 views

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.

    This topic has been closed for replies.
    Correct answer Carl Von Stetten

    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.

    1 reply

    Carl Von Stetten
    Legend
    September 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.

    September 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"/>

    Carl Von Stetten
    Carl Von StettenCorrect answer
    Legend
    September 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.