ColdFusion MX 7.0基于Flash的多文件上传器在上传2/3文件后导致问题

时间:2010-07-08 03:24:39

标签: coldfusion multifile

我有一个应用程序在ColdFusion MX 7.0中使用单点登录进行登录。它本质上 在application.cfm中有一个cfldap。但真正的问题是我正在尝试使用多文件上传第三方工具,该工具提交了一个带有cffile和其中的东西的coldfusion脚本。 当我尝试同时上传3个以上的文件时,基于Flash的工具和基于Java的工具都会出现问题。首先,他们再次提示基于Windows的登录。即使我正确输入凭据,上传过程也会完全停止,只有1/2 文件已上传。

2 个答案:

答案 0 :(得分:0)

multi_file上传的接口(表单)代码

<body>
    <div id="EAFlashUpload_placeholder"></div>
        <cfparam name="session.multiUploadError" default="">
        <cfif session.multiUploadError neq "">
            <font color="#FF0000"><em> <strong>Error Uploading File: </strong>      
            <cfoutput>#session.multiUploadError#</cfoutput></em></font>

            <!--- ok. now wipe the error message clean for next time --->

            <cfset session.multiUploadError = "">

       </cfif><p></p>
       <script type="text/javascript" src="swfobject.js"></script>
       <script type="text/javascript">
           var params = {  
               wmode: "window"
           };

           var attributes = {  
               id: "EAFlashUpload",  
               name: "EAFlashUpload"                            
           }; 

          var flashvars = new Object();      
          flashvars["uploader.uploadUrl"] = "http://iapreview.ars.usda.gov/admin/sp2.5/MultiFileUpload.cfm";
         flashvars["viewFile"] = "TableView.swf"; 
         flashvars["queue.filesCountLimit"] = "30"; 
         flashvars["uploader.retrieveBrowserCookie"] = true;

         swfobject.embedSWF("EAFUpload.swf", "EAFlashUpload_placeholder", "450", "350", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

    </script>
</body>

后端ColdFusion脚本的代码

<cftry>
    <cfif isDefined("Form.Filedata")>
        <cffile action="UPLOAD" filefield="Filedata"  destination="#session.siteDirectory#\#session.Directory#" nameconflict="OVERWRITE">

        <cfif right(cffile.clientFile, 3) neq "htm" and right(cffile.clientFile,4) neq ".htm"> 


        <cfelse>
            <cffile action="delete" file="#session.siteDirectory#\#session.Directory#\#cffile.clientFile#">
            <cfset session.multiUploadError = " " & session.multiUploadError & " #cffile.clientFile# could not be uploaded, because html files are not permitted.<br> ">

        </cfif>

    <!--- 
       <cffile action="APPEND" file="f:\sitepublisher_dev\sp2\juploadoutput.txt" output="#idx# - #session.siteDirectory#\#session.Directory#\#cffile.clientFile# (#cffile.fileSize#) at #cffile.timeLastModified#" addnewline="Yes">
    --->
    </cfif>

      该文件尚未保存。请检查目标文件夹是否存在并具有读/写权限。          

答案 1 :(得分:0)

<cftry>
<cfif isDefined("Form.Filedata")>
    <cffile action="UPLOAD" filefield="Filedata"  destination="#session.siteDirectory#\#session.Directory#" nameconflict="OVERWRITE">

<cfif right(cffile.clientFile, 3) neq "htm" and right(cffile.clientFile,4) neq ".htm"> 


<cfelse>
    <cffile action="delete" file="#session.siteDirectory#\#session.Directory#\#cffile.clientFile#">
    <cfset session.multiUploadError = " " & session.multiUploadError & " #cffile.clientFile# could not be uploaded, because html files are not permitted.<br> ">

</cfif>

<!--- 
 <cffile action="APPEND" file="f:\sitepublisher_dev\sp2\juploadoutput.txt" output="#idx# - #session.siteDirectory#\#session.Directory#\#cffile.clientFile# (#cffile.fileSize#) at #cffile.timeLastModified#" addnewline="Yes">
 --->
</cfif>
<cfcatch type="Any">
  <cfoutput><eaferror>The file has not been saved. Please check destination folder exists and has read/write permissions.</eaferror></cfoutput>
    </cfcatch>