Force PDF Download is OK, Popup Remains Open on Win2k?
Posted on 2004-10-18
I've successfully forced a PDF to come up with a file download box. The popup on XP SP2 with all IE updates works perfect, it opens a 100x100 pixel box in the lower right of the screen, after you hit the save button the file downloads and the popup closes. I see hidden popups are not allowed offscreen anymore with all the new IE updates.
On another PC with win2k, the popup box is hidden off screen, the file downloads OK, but the popup doesn't close after the file is downloaded successfully. Attempted to use <<body onLoad="window.close();"> but it seems that using the CFHEADER AND CFCONTENT tages forces everything else to be ignored.
Here I am calling act_download_pdf.cfm with the filename attached to the URL
Then in the act_download_pdf.cfm I have the following code to force the PDF to open a Save As box
<CFSET variables.str_filepath = "#request.str_server_root#documents/">
<CFSET variables.str_filename = "#request.str_filename#">
<CFSET variables.str_fullpath = "#variables.str_filepath##variables.str_filename#">
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=#variables.str_filename#">
<CFCONTENT TYPE="application/pdf" FILE="#variables.str_fullpath#" DELETEFILE="no" RESET="no">