此问题仍然存在,无法在应用程序中运行进程的其余部分,即按文件类型和压缩功能进行文件排序。我遇到的问题是我的pdf压缩代码导致多文件上传器冻结率达到99%,仍然成功上传第一个文件但阻止后续文件上传。
问题1:当我尝试从列表中排除pdf文件时,文件上传失败。
问题2:存在用于压缩pdf文件的查询和循环代码会导致文件上载程序停止在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>