目前,我有
<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.ClientFileExt#>
<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#>
当我提交时,我收到错误消息
标记CFFILE的属性验证错误。
属性源的值(当前为E:\temp\uploads\File.pdf
)无效,并且此行被引用。来自代码段的destination="#filedirectoryYear##submittedfileName#"
<cffile
action="rename"
source="E:\temp\uploads\#presentfileName#"
destination=#filedirectoryYear##submittedfileName#
>
存在filedirectoryYear
路径。可能是什么问题?我在带有IIS的Windows机器上使用ColdFusion 8
答案 0 :(得分:0)
你觉得CF指的是一个不正确的目的地,但精明的观察者会注意到错误信息指出“源”是问题所在。
您的代码声称来源为E:\temp\uploads\(some variable)
错误声明来源为c:\Course Syllabi\uploads\Web Based System Two Page Handout.pdf
我会回过头来确定你正在调试正确的代码行。
答案 1 :(得分:0)
对于此类错误,请检查文件的路径,如果目标路径或源路径不正确,则会发生此错误
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