On a site that I'm working on, there's a lot of MS Word documents available to download.  Instead of letting IE open the document in a window, I have a download.cfm page that uses cfheader to force the document to download.  

Unfortunately, I can't figure out how to get the previous page that the link was called from to reload, which updates the list of available documents and removes the one that was just downloaded.

For example:
documents.cfm

Link to document to download:  index.cfm?pgid=download&resID=#res_id#

download.cfm

[some queries here to change status]

<cfheader name="content-disposition" VALUE="attachment; filename=#selResume.res_filename#">
<cfcontent type="application/octet-stream" file="#session.mainuploadpath#\#selResume.res_filename#" Deletefile="no">

What I need to get to happen is documents.cfm be automatilly refreshed / reloaded after clicking on the link to start the download.

I'm assuming there's now way to put anything else on the download.cfm page just as _javascript_ or a cflocation that would force the documents.cfm page to download because of the cfheader tag.

The other method I'm working on is close - but uses _javascript_ to open a window - which could cause problems with pop-up blockers.

The link for the document to download is:
<a href="" >
And then the _javascript_ is:

<script>
  function timedreload(inRes) {
     window.open("index.cfm?pgid=download&resID=" + inRes,"download","width=10,height=10,scrollbars=0,resizable=0");
     setTimeout("window.location.reload();",3000);
     setTimeout("window.close.download;",6000);
  }
</script>

Problem here is that the download window doesn't want to close automatically, and, it uses a pop-up which could cause problems with pop-up blockers.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to