 
 			Please review the instructions on the upload page, and contact us if you need assistance to resolve the problem.
 
+			More information may be available at #application.serverRootUrl#/tools/uploadMedia.cfm?action=preview###d.zid#
+
 			<cfquery name="r" datasource="uam_god">
 				update cf_temp_zipload set status='complete_email_sent - ' || status where zid=#d.zid#
 			</cfquery>
-
 		<cfelse>
 
-
-
-
-			<cfquery name="f" datasource="uam_god">
-				select * from cf_temp_zipfiles where zid=#d.zid#
-			</cfquery>
-			<cfset q=QueryNew("TEMP_original_filename, TEMP_new_filename,MEDIA_URI,MIME_TYPE,MEDIA_TYPE,PREVIEW_URI,media_license,media_label_1,media_label_value_1")>
-
-			<cfloop query="f">
-				<cfset queryaddrow(q,
-						{
-						TEMP_original_filename=filename,
-						TEMP_new_filename=new_filename,
-						MEDIA_URI=remotepath,
-						MIME_TYPE=mime_type,
-						MEDIA_TYPE=media_type,
-						PREVIEW_URI=remote_preview,
-						media_license='',
-						media_label_1='MD5 checksum',
-						media_label_value_1=md5
-						}
-					)>
-			</cfloop>
-
-			<cfdump var=#q#>
-
-			<cfset  util = CreateObject("component","component.utilities")>
-			<cfset csv = util.QueryToCSV2(Query=q,Fields=q.columnlist)>
-			<cffile action = "write"
-			    file = "#Application.webDirectory#/download/media_bulk_zip#d.zid#.csv"
-		    	output = "#csv#"
-		    	addNewLine = "no">
-
+			<cfset makeMBLDownloadFile(#d.zid#)>
 
 			Dear #d.username#,
 

			<br>Job Name: #JOBNAME#
			<br>Submitted Date: #submitted_date#
			<br>Status: #STATUS#


			<cfquery name="f" datasource="uam_god">


<hr>

<cffunction name="makeMBLDownloadFile">
	 <cfargument name="zid" required="true" type="numeric"/>
	 <cfquery name="f" datasource="uam_god">
		select * from cf_temp_zipfiles where zid=#zid#
	</cfquery>
	<cfset q=QueryNew("TEMP_original_filename, TEMP_new_filename,MEDIA_URI,MIME_TYPE,MEDIA_TYPE,PREVIEW_URI,media_license,media_label_1,media_label_value_1")>

	<cfloop query="f">
		<cfset queryaddrow(q,
				{
				TEMP_original_filename=filename,
				TEMP_new_filename=new_filename,
				MEDIA_URI=remotepath,
				MIME_TYPE=mime_type,
				MEDIA_TYPE=media_type,
				PREVIEW_URI=remote_preview,
				media_license='',
				media_label_1='MD5 checksum',
				media_label_value_1=md5
				}
			)>
	</cfloop>
	<cfset  util = CreateObject("component","component.utilities")>
	<cfset csv = util.QueryToCSV2(Query=q,Fields=q.columnlist)>
	<cffile action = "write"
	    file = "#Application.webDirectory#/download/media_bulk_zip#d.zid#.csv"
    	output = "#csv#"
    	addNewLine = "no">
</cffunction>
<!------------------------------------------------------------------------------------------------>
<cfif action is "notify_done">
	<cfoutput>
