标签 CFFILE 的属性验证错误
目前,我
<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##subscribedfileName#"
<cffile
action="rename"
source="E:\temp\uploads\#presentfileName#"
destination=#filedirectoryYear##submittedfileName#
>
filedirectoryYear
路径存在。可能是什么问题?我在带有 IIS 的 Windows 计算机上使用 ColdFusion 8
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.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#>
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您感觉 CF 指向了错误的目的地,但是精明的观察者会注意到错误消息指出“源”是问题所在。
您的代码声称源是
E:\temp\uploads\(some variable)
该错误声称源是
c:\Course Syllabi\uploads\Web Based System Two Page Handout.pdf< /code>
我会回过头来确保您正在调试正确的代码行。
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.