Coldfusion 9 Flash Multifile Upload Widget fails due to unrelated code -
this issue continues along inability run remaining parts of process in application, namely file sorting file type , compression capability. i'm running issue pdf compression code causing multifile uploader freeze @ 99%, still uploading first file preventing subsequent files uploading.
issue 1: file upload fails when try exclude pdf files list.
issue 2: presence of query , loop code compress pdf files causes fileuploader stop @ 99%, still uploading first file no subsequent files in multi-file upload.
multifile upload handler code
<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 list of files multifile upload module---> <cfset uploadedfilenames='#myfiles.clientfile#' > <!---exclude pdf file types file list relocate 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 upload failure begins: when original variable set result of above code** <cfset uploadedfilenames = lresultlist /> subsequent code not execute <cfquery name="addfile" datasource="#request.dsn#"> insert 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 pulls file list db table of files uploaded , loops through names executing pdf compression app on files---> cffunction access="remote" name="compressfiles" returntype="void" output="no"> <!---get file list , loop through compression---> <cfquery name="qrygetfilesjustuploaded" datasource="#request.dsn#"> <!--- limit filed pdf file type endings ---> select fileupload [first_title_services_dev].[dbo].[upload_many] filedate >= '#datetimestamp#' , fileupload '% .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>
Comments
Post a Comment