Category Archives: coldfusion

COLDFUSION | Troubleshooting ‘The value of the attribute source … is invalid’ for CFFILE tag

A colleague and I were migrating code to a new CF9 development environment. We were testing a page that used <cffile> tag to move and rename a file as follows:

<CFSET ThisSource = “\\fubarserver\share$\newyork\aaa.cfm“>
<CFSET ThisDestination = “\\fubarserver\share$\chicago\archive\110407-aaa.cfm“>
<CFTRY>
<CFFILE
ACTION = “rename”
SOURCE = “#ThisSource#”
DESTINATION = “#ThisDestination#”>
<CFCATCH>
<CFOUTPUT>
<p>#cfcatch.detail#
</CFOUTPUT>
<CFABORT>
</CFCATCH>
</CFTRY>

The page gave the following error:

The value of the attribute source, which is currently “\\fubarserver\share$\newyork\aaa.cfm“, is invalid.

This made no sense, as we could clearly establish that path was valid and assessible to the website and the ColdFusion instance. Turns out the message is very misleading: the problem was file systems permissions. The CF service account only had ‘read&execute’ permissions on the source directory, and that was the issue. Apparently, even though the ‘rename’ was coded to move the file to a path where the CF service account had ‘modify’ permissions, it required that for any rename operation it should also have ‘modify’ permissions to the source directory; when I set the source directory permissions accordingly, the code executed fine.