Shaun Mccran

My digital playground

01
S
E
P
2009

Incorrect error message reporting using CFFile action rename

During a batch process that I was writing recently I was using a CFfile operation to rename some files.

When running it I came across this error message:

view plain print about
1Attribute validation error for tag CFFILE.
2The value of the attribute source, which is currently "C:\fullUrl.jpg", is invalid.

This is the calling cfml code. The actual variable values aren't important.

view plain print about
1<cffile action="rename" source="#variables.tmpFileLocation#" destination="#variables.dir#/#variables.photoid#.jpg">

So I checked and doubled check the source url, and manually browsed to the directory and viewed it. The file was right there! I had a wander around online and found that this isn't a new issue, but more a bad error report.

The error isn't actually relating to the 'source' attribute at all, but rather the 'destination' attribute. In this case it was a file/folder permissions problem. (I didn't have write access). It was simply a case of Coldfusion server reporting it incorrectly.

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
todd sharp's Gravatar Yeah, this one will drive you nuts til you figure it out. I could swear I filed a bug on this, but just in case I didn't maybe you could file one.
# Posted By todd sharp | 01/09/2009 17:41
Shaun Mccran's Gravatar Good plan Todd, I'll file one now, quite surprised its still around, as some online docs show it to have been present in cfmx 6.
# Posted By Shaun Mccran | 02/09/2009 09:44
Back to top