 					</cfif>
 				</cftransaction>
 			</cfloop>
+		</cfloop>
+	</cfoutput>
+</cfif>
+
+<!------------------------------------------------------------------------------------------------>
+<cfif action is "mkprvw_confirm">
+	<cfoutput>
+		<cfquery name="d" datasource="uam_god">
+			select * from cf_temp_zipload where status='renamed' and rownum=1
+		</cfquery>
+		<cfquery name="d_f" datasource="uam_god">
+			select distinct status from cf_temp_zipfiles where zid=#d.zid#
+		</cfquery>
+		<cfif valuelist(d_f.status) is "previewed">
+			<br>all previewed
 			<cfquery name="r" datasource="uam_god">
-				update cf_temp_zipload set status='madepreview' where zid=#d.zid#
+				update cf_temp_zipload set status='previewed' where zid=#d.zid#
 			</cfquery>
-		</cfloop>
+		<cfelse>
+			<br>previewed not complete, do nothing
+		</cfif>
 	</cfoutput>
 </cfif>
 <!------------------------------------------------------------------------------------------------>

<br>s2: getFile (submit f. nothing)
<br>will schedule
<br><a href="uploadMedia.cfm?action=unzip">unzip</a>
<br><a href="uploadMedia.cfm?action=rename">rename</a>
<br><a href="uploadMedia.cfm?action=mkprvw">mkprvw</a>
<br><a href="uploadMedia.cfm?action=s3ify">s3ify</a>

<hr>
<cfif action is "s3ify">
	<cfoutput>
		<cfquery name="d" datasource="uam_god">
			select * from cf_temp_zipload where status='madepreview' and rownum=1
		</cfquery>
		<cfif d.recordcount is 0>
			found nothing<cfabort>

						source = "#Application.webDirectory#/temp/#d.zid#/#filename#"
						destination = "#Application.webDirectory#/temp/#d.zid#/#nfileName#">
					<cfquery name="r" datasource="uam_god">
						update cf_temp_zipfiles set status='renamed',new_filename='#nfileName#' where zid=#d.zid# and filename='#filename#'
					</cfquery>
					<br>new:#nfileName#
				</cftransaction>
			</cfloop>
		</cfloop>
	</cfoutput>
</cfif>

<!------------------------------------------------------------------------------------------------>
<cfif action is "rename_confirm">
	<cfoutput>
		<cfquery name="d" datasource="uam_god">
			select * from cf_temp_zipload where status='unzipped' and rownum=1
		</cfquery>
		<cfquery name="d_f" datasource="uam_god">
			select distinct status from cf_temp_zipfiles where zid=#d.zid#
		</cfquery>
		<cfif valuelist(d_f.status) is "renamed">
			<br>all renamed
			<cfquery name="r" datasource="uam_god">
				update cf_temp_zipload set status='renamed' where zid=#d.zid#
			</cfquery>
		<cfelse>
			<br>rename not complete, do nothing
		</cfif>
	</cfoutput>
</cfif>
<!------------------------------------------------------------------------------------------------>
