标签 CFFILE 的属性验证错误

发布于 12-09 03:10 字数 1751 浏览 0 评论 0原文

目前,我

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彩虹直至黑白2024-12-16 03:10:41

您感觉 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.

转身以后2024-12-16 03:10:41

对于此类错误,请检查文件的路径。此错误发生在目标或源路径不正确的情况下

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文