Author: TomdeMan
Related Categories:
ColdFusion, Virtual Machine / VM, Coldspring
July 26, 2007
I am running ColdFusion on my Windows 2003 Server VM. I have my files on my local machine, available to my VM via a shared folder. Meaning, IIS and CF see it as \.hostShared FoldersWebroot When Coldspring is initialized it runs theshrinkFullRelativePath method in the DefaultXmlBeanFactory.cfc
If you are passing in an expanded path then Coldspring will thrown an error because of the rebuilding of the path and the '\' before '.host' gets stripped down to '/' and is not a valid path.
Or, you are sending in a relative path and its just not found at all.
In the meantime modify this check before the return of the shrinkFullRelativePath method to:
<cfif left(retVal,2) is "/.">
<cfset retVal = "/" & retVal>
</cfif>
<!--- Modified to Allow Relative Path --->
<cfif not directoryExists(getDirectoryFrompath(retVal)) and not directoryExists(getDirectoryFrompath(expandPath(retVal)))>
<cfthrow message="You have specified an invalid directory" detail="The directory path specified, #getDirectoryFromPath(retVal)# does not exist." />
</cfif>
If your're not dealing with a VM but still want to use Relative Paths, only use the second if statement.
** This may only be good for people using ColdFusion 7 and Up. (Application root mapping support issues)





Comments:
[Add Comment]