views:

26

answers:

2

Hi,

I have an application that uses a single signon for login in Coldfusion Mx 7.0. It essentially has a cfldap in the application.cfm. But the real issue is that I am trying to use a multi-file upload third party tool that submits to a coldfusion script with cffile and stuff in it. Both the Flash based tool and the Java based tool are cauing an issue when I try a uploading more than 3 files at the same time. First they prompt the windows based login again. Even though I type in the credentials correctly, the upload process stops completely and only 1/2 files are uploaded.

A: 

The code for the Interface(form) for multi_file upload

<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>

The code for the backend ColdFusion script

<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>

The file has not been saved. Please check destination folder exists and has read/write permissions.

bestman12345
A: 
<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>
bestman12345