 
 
 		<cfquery name="f" datasource="uam_god">
-			select * from cf_temp_zipfiles where zid=#d.zid#
+			select * from cf_temp_zipfiles where zid=#d.zid# and status='previewed' and rownum=1
 		</cfquery>
 		<cfloop query="f">
 			<cffile variable="content" action="readBinary" file="#Application.webDirectory#/temp/#d.zid#/#new_filename#">
-			<cfset md5 = createObject("component","includes.cfc.hashBinary").hashBinary(content)>
-
-			<br>md5: #md5#
+
+			<br>content: #content#
+			<cfset lmd5 = createObject("component","includes.cfc.hashBinary").hashBinary(content)>
+
+			<br>lmd5: #lmd5#
+
+
 			<cfquery name="ckck" datasource="uam_god">
 				select media_id from media_labels where MEDIA_LABEL='MD5 checksum' and LABEL_VALUE='#md5#'
 			</cfquery>

				<cfdirectory action = "create" directory = "#Application.webDirectory#/temp/#d.zid#/tn" >
			</cfif>
			<cfquery name="f" datasource="uam_god">
				select * from cf_temp_zipfiles where zid=#d.zid# and preview_filename is null and rownum <20
			</cfquery>
			<cfloop query="f">
				<cftransaction>


			<cfquery name="lldd" datasource="uam_god">
				update cf_temp_zipfiles set
					md5='#lmd5#',
					remotepath='#media_uri#',
					mime_type='#mimetype#',
					media_type='#mediatype#',
