I have some code that creates a zip file of some image and then right after that code it tries to download the file. This works fine when the zip file is very small but when it is larger it tries to download the file before it is actually completed being created.
So something like this
<CFZIP code here>
<cfset TheFileName = "#ReReplace(GetImage.ItemNum, " ", "-", "ALL")#.zip">
<cfheader name="Content-disposition" value="attachment;filename=#TheFileName#">
<cfcontent type="application/zip, application/x-zip, application/x-zip-compressed, application/octet-stream, application/x-compress, application/x-compressed, multipart/x-zip" file="#APPLICATION.ProductImageDirectory#\full-brands\#TheFileName#">