Create a mapping in the Coldfusion Administrator, and use it to point to files that are away from the web root. For example, create the following mapping:
Logical Path: /myDir
Directory Path: D:\anyPath\myDirectory
You can then create an instance of D:\anyPath\myDirectory\test.cfc as
and you can include D:\anyPath\myDirectory\myFile.cfm in any arbitrary page, using
The solution provided by you has still not resolved the problem.When the file is placed in the C:\Inetpub\wwwroot, the path being referred is \myDirectory\ServerSidehelloworld.cfc and is working perfectly fine whereas if it is placed in D:\anyPath\myDirectory\, it is only being referred as ServerSidehelloworld.cfc for the following cfc file
<cfajaxproxy cfc="ServerSidehelloworld" jsclassname="helloworldproxy">
as given in the demo.
The path given as myDir.ServerSidehelloworld is also throwing an error when given for cfc attribute of <cfajaxproxy>.
Please provide your comments on how to access this cfc file when placed in the D: directory of the machine.
On debugging we found that it is throwing error saying req.Status ="404" and req.StatusText="Not Found" when
req=$A.createXMLHttpRequest();) in cfajax.js file.
You're right, Meenakshi. Relative paths to a cfc and paths derived from a mapping are valid when used in createobject() and cfinclude. However, they fail when used as the value of the cfc attribute in <cfajaxproxy>. Shame.
I have submitted a bug report. Contents follow:
Put the cfc to be proxied, proxy.cfc, in any directory off the webroot, for example, c:\temp\test\proxy.cfc.
The following values for the cfc attribute fail. In each case Coldfusion tells you it cannot find the cfc.
(1) Define the mapping testMapping in the Administrator as follows
logical path: /testMapping
directory path: c:\temp\test
Then do <cfajaxproxy cfc="testMapping.proxy" jsclassname="proxy"> or <cfajaxproxy cfc="/testMapping.proxy" jsclassname="proxy">
This fails because the value of the cfc attribute may not be a mapping.
(2) The relative-path versions <cfajaxproxy cfc="..\..\..\..\..\temp.test.proxy" jsclassname="proxy"> or <cfajaxproxy cfc="..\..\..\..\..\temp\test\proxy.cfc" jsclassname="proxy"> don't work either because the path may not begin with a dot.
(3) <cfajaxproxy cfc="c:\temp\test\proxy.cfc" jsclassname="proxy"> fails, even though the documentation says the cfc attribute can be the absolute path.