Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFile Attribute validation error

Status
Not open for further replies.

firepwr

IS-IT--Management
May 22, 2006
31
US
I've got a web application that uploads a small photo to a "temp" directory one level below the final directory where the photo files will reside (CF MX version 6,1,0,63958). After uploading the file (which IS successful---the file is uploaded to the temp directory), my intention is to validate it and then move the file to final directory. When I try to move the file, however, I get the infamous [tt]Attribute validation error for tag CFFILE[/tt] error. I've tried to fix the areas that have been mentioned in the numerous other posts regarding this error (e.g. dots in the path, file permissions, setting the path to a variable first, etc....) but so far with no luck.

Here's the code snippet that bombs (note that the file DOES exist at the source):

Code:
<cfset pic="c:\websites\lifeline\comments\pictures\temp\#Session.Pic_File#">

<!-- This is for troubleshooting -->
<cfoutput>pic is: #pic#</cfoutput><br><br>

<cffile action = "move"
  	source = "#pic#"
  	destination = "c:\websites\lifeline\comments\pictures\">

This gives me the following error:

cffile_error.jpg


What really gets me though is that if I hard code the path for the source in a separate test file (below), IT WORKS JUST FINE (the file is moved successfully)!

Code:
<cffile action = "move"
  	source = "c:\websites\lifeline\comments\pictures\temp\Paul_Head.jpg"
  	destination = "c:\websites\lifeline\comments\pictures\">

Does anyone have any ideas that might help???

Paul.
 
Have you tried appending the file name to the destination to see if that makes a difference?

Code:
<cfset pic="c:\websites\lifeline\comments\pictures\temp\#Session.Pic_File#">

<!-- This is for troubleshooting -->
<cfoutput>pic is: #pic#</cfoutput><br><br>

<cffile action = "move"
      source = "#pic#"
      destination = "c:\websites\lifeline\comments\pictures\#Session.Pic_File#">

Hope this helps

Wullie

Fresh Look - Quality Coldfusion 7/Windows Hosting
YetiHost - Coming Soon

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I just tried it but unfortunately no change....
 
I don't know if this is relevant or not but the following is from the application log when the error occurs:

[tt]"Error","jrpp-8","05/23/06","07:57:32","AddPic","Attribute validation error for tag CFFILE.The value of the attribute source, which is currently ""c:\websites\lifeline\comments\pictures\temp\[highlight]<cfoutput>[/highlight]Paul_Head.jpg[highlight]</cfoutput>[/highlight]"", is invalid. The specific sequence of files included or processed is: C:\Websites\Lifeline\comments\add_comment2.cfm "[/tt]

I noticed that it added cfoutput tags around the actual file names which I thought looked a little odd.... Is this normal or could it have something to do with the problem? Any thoughts?
 
You wouldn't happen to have this anywhere would you?
Code:
<cfset Session.Pic_File = "<cfoutput>#YourVariableName#</cfoutput>">
If so, remove the quotes and cfoutput tags.
Code:
<cfset Session.Pic_File = YourVariableName>


Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
No, that's what's really weird about seeing it in the log.... All I do is this line:

Code:
<cfset pic="c:\websites\lifeline\comments\pictures\temp\#Session.Pic_File#">

This is a really frustrating error...I sure hope someone can help!
 
Well I FINALLY figured out what the issue was. On a PREVIOUS page (where I defined the value Session.Pic_File I had inadvertently put <cfoutput> tags in the <cfset> tag. This was VERY difficult to see after-the-fact since everytime I "tested" the value of the variable by outputting it to the screen the <cfoutput> tags of course did not show up. When the <cffile> tag looked at the variable, however, it saw the <cfoutput> tags in the path and consequently bombed.... Grrrrrrrrrrr!

Thanks for everyone who looked at this whether or not you had a response!

Paul.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top