This has more than you want but:

I have this form on one page.

<form action="/act_dnldReports.cfm" method="post">
        <select name="cndRprt" size="5" value="pub_report_id" multiple
id="SmerFont">
        <cfoutput query="cannedReports">
                <option value="#pub_report_id#">#dateFormat(pub_report_date,
'YYYYMMDD')# - #pub_report_desc#
            </cfoutput>
     </select><br><br>
     <input type="submit" value="Download Reports" id="SmerFont">
</form>

The user selects the reports they want to download and hit the submit button
which calls this file.  The main page never refreashes and the only thing
that opens is the download dialog.

<cfinclude template="../app_globals.cfm">

   <cfquery datasource="#dsn#" name="rprtPath">
      SELECT
         pub_report_path
      FROM
         pub_report_detail prd
      WHERE
         pub_report_id IN (#attributes.cndRprt#)
   </cfquery>
   
   <cfoutput query="rprtPath">
      #pub_report_path#<br>
   </cfoutput>
   <cfset allFiles = valueLIst(rprtPath.pub_report_path)>
<cftry>
   <cfoutput query="rprtPath">
      <cfset path = GetDirectoryFromPath(pub_report_path)>
      <cfset fName = "#path##client.username#.zip">

      <CFX_JCompress ACTION="NEW" FILEIN="#allFiles#" FILEOUT="#fName#">
      <cfexecute name="/bin/chmod" arguments="-R 775 #fName#"
timeOut="15"></cfexecute>

      <CFHEADER NAME="Content-Disposition"
VALUE="filename=#client.username#.zip">
      <cfcontent type="application/x-zip-compressed" file="#fName#"
deletefile="Yes">

   </cfoutput>
<cfcatch type="Any">
   <cfdump var="#cfcatch#">
</cfcatch>
</cftry>

Shawn McKee
-----Original Message-----
From: Margaret Fisk [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 12:58 PM
To: CF-Talk
Subject: RE: CFCONTENT and closing the main page


Hi everyone,

I am using CFCONTENT to force a download dialog box (thanks to some help
from this list :-)) and I have an additional question.

Right now, I pop up a separate window that then pops up the File Download
dialog.  However, the original window stays open even after the download is
complete and displays as a blank page.

I'm going to work on putting a "Click Save on the File Download dialog box"
message to avoid the blank page, but this is rather obvious.  Is there any
way to close the window after the File Download box has displayed...without
disrupting the download of course.

Thanks in advance,
Margaret Fisk 
Manager of Customer Support
[EMAIL PROTECTED] 
Quiver, Inc. 
2121 El Camino Real
Suite 300
San Mateo, CA 94403 
Quiver...Knowledge is Your Advantage 
Visit our website: << http://www.quiver.com/>> 

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to