An incredibly usefull CFFILE error message
I thought I’d blog about this because I haven’t found any mention of it anywhere else on the web.
I was working with CFFILE today and the tag kept throwing the following error while attempting to move a file:
Attribute validation error for tag CFFILE.
The value of the attribute source, which is currently "C:\JRun4\ser...\cfusion-war-tmp\uploaded-file.dat", is invalid.
I must’ve spent half an hour trying to figure out why the path in the source attribute was invalid. The path was correct, the file was there, everything about the source attribute was fine!
I finally decided to check the other attributes just in case (yeah, I know, I should’ve done that much much earlier). It turned out the destination path was pointing to a folder that didn’t exist. So it wasn’t the source attribute that was invalid but the destination attribute. I did a few tests and I found out that the only invalid value of the destination attribute that actually throws a meaninful error is an empty string. Any other invalid path throws the source attribute error.
Note: This was on CFMX7. No idea whether this also happens on other ColdFusion server editions.
