Attribute validation error for tag CFFILE
Currently, I have
<cfset filedirectoryYear = "E:\FilesSubmitted\"&#form.current_year#&"\"&#form.division#&"\">
<cfif FORM.attachment_1 neq "">
<cffile action="upload"
accept="text/plain,application/msword,application/pdf,application/rtf"
filefield="attachment_1"
destination="E:\temp\uploads"
nameconflict="Makeunique"
>
<!--- rename the file and move it to permanent destination --->
<cfset submittedfileName =
#form.departmentname#&"_"&#form.departmentnumber#&"_"&#form.section_number_1#&"."&#cffile.ClientFileEx开发者_JAVA技巧t#>
<cfset presentfileName = #cffile.serverFileName#&"."&#cffile.ClientFileExt#>
<cffile
action="rename"
source="E:\temp\uploads\#presentfileName#"
destination=#filedirectoryYear##submittedfileName#
>
<!--- now create a temporary variable for the attachment so that it can be emailed later on --->
<cfset attachment_local_file_1 =
#filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#>
</cfif>
<cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#>
When I submit, I get the error message
Attribute validation error for tag CFFILE.
The value of the attribute source, which is currently E:\temp\uploads\File.pdf
, is invalid and this line is referred. destination="#filedirectoryYear##submittedfileName#"
from the snippet
<cffile
action="rename"
source="E:\temp\uploads\#presentfileName#"
destination=#filedirectoryYear##submittedfileName#
>
The filedirectoryYear
path exists. What could be the issue? I am using ColdFusion 8 on a Windows machine with IIS
You feel CF is pointing to an incorrect destination, however the astute observer will note that the error message is pointing out the "source" as the problem.
Your code claims the source is E:\temp\uploads\(some variable)
The error claims the source is c:\Course Syllabi\uploads\Web Based System Two Page Handout.pdf
I'd circle back and make certain you are debugging the correct line of code.
For this type of error please check the path of your file this error occur at the case of incorrect destination or source paths
check desired folder exist in same path
check Root Directory mean site URL is it correct
print the path and verify it with your directory surely there will be any conflict remove it that's why this error arising
精彩评论