ColdFusion的9闪光灯多文件上传控件失败,因为无关的代码(Coldfusion 9 Flas

2019-10-23 10:20发布

这一问题无法运行过程中的剩余部分中的应用,即文件排序按文件类型和压缩能力继续沿着。 我正在为我的PDF格式的压缩编码是造成多文件上传到99%冻结的问题,仍然成功上传的第一个文件,但随后防止文件从上传。

问题1:当我尝试从列表中排除的PDF文件,文件上传失败。

问题2:的查询和循环代码压缩PDF文件的存在导致fileuploader停止在99%,仍在上传的第一个文件,但在多文件上传没有后续文件。

多文件上传处理程序代码

 <cfif Files eq 'Multiple'>
<cffile action="upload" destination= "c:\uploads\" result="myfiles" 
nameconflict="makeunique" >

<cfset fileSys = CreateObject('component','cfc.FileManagement')>

<cfif Len(get.realec_transactionid)>
    <cfset internalOnly=1 >
</cfif>     

    <cfset uploadedfilenames='#myfiles.clientFile#' >



   <!---This variable contains the list of files from the multifile upload module--->    
    <cfset uploadedfilenames='#myfiles.clientFile#' >




<!---Exclude PDF file types from the file list to relocate to the NAS--->
                   <cfset lResultList = ""/>
            <cfset fileExtToExclude = "pdf" />
            <cfloop list="#uploadedfilenames#" index="fileItem" delimiters=",">
            <cfif ListLast(ListLast(fileItem, '\'), '.pdf') NEQ  
            fileExtToExclude>
            <cfset lResultsList = ListAppend(lResultList, fileItem) />
            </cfif>
            </cfloop>
**This is where the upload failure begins: when the original variable is set as the result of the above code**

        <cfset uploadedfilenames = lResultList />
        This subsequent code does not execute

    <cfquery name="addFile" datasource="#request.dsn#">
            INSERT INTO upload_many (title_id, fileDate, filetime, fileupload)
                    VALUES('#get.title_id#', '#dateTimeStamp#', '#a_insert_time#', '#new_file_name#')
        </cfquery>  

    <cfelse>    
        <cffile action="upload" destination= #ExpandPath("./uploaded_files/zip.txt")# nameconflict="overwrite" >
    </cfif>
    <!---This block then pulls a file list from the DB table of files just uploaded and then loops through the names executing the pdf compression app on the files--->
    cffunction access="remote" name="compressFiles" returntype="void" output="no">
        <!---Get File List and Loop Through Compression--->
        <cfquery name="qryGetFilesJustUploaded" datasource="#request.dsn#">                                            
     <!--- Limit to filed with pdf file type endings --->
        SELECT fileupload
        FROM [First_Title_Services_Dev].[dbo].[upload_many]
        WHERE filedate >= '#dateTimeStamp#' AND fileupload Like '% .pdf'
        </cfquery>

        <cfloop query="qryGetFilesJustUploaded">
        <cfset pdf_file_name = 'qryGetFilesJustUploaded.fileupload' />
        <cfexecute name="C:\Program Files (x86)\neeviaPDF.com\PDFcompress\cmdLine\CLcompr.exe"
        arguments="C:\uploads\#pdf_file_name# C:\uploads\#pdf_file_name# -co -ci jpg -cq 10 -gi jpg -gq 10 -mi jbig2 -mq 1"
        outputfile="C:\uploads\output.txt"  
        timeout="250">
        </cfexecute>
        </cfloop>
        </cffunction>
文章来源: Coldfusion 9 Flash Multifile Upload Widget fails due to unrelated code