Refresh Parent Page with CFCONTENT

Posted on 2014-07-15
Last Modified: 2014-07-21
We open a page with a HREF - <A HREF="mylist.cfm?type=iapr&RequestTimeout=3000" target="_blank">

I run some coldfusion scripts to update the db to reflect the user request - then I need to refresh the parent page before generating the excel file that the user requested.

<script language="javascript">

Open in new window

<cfcontent type="application/msexcel">
<cfheader name="Content-Disposition" value="filename=#filename#.xls">

Open in new window

It isn't refreshing the parent page.  If I do a cfabort, it works just fine.   Is there something else I can do to facilitate this process?
Question by:digitalwise
    1 Comment
    LVL 51

    Accepted Solution

    (no points.. )

    It can't be done in the same page. With a few exceptions, a page can only contain a single type of content. So your download page can either return an excel file ie "application/msexcel" or "text/html" (ie javascript, css...) . Not both. The cfcontent causes the javascript code to be ignored. That's why it's not firing.

    I don't have an example handy, but you could do it with jquery. In the parent page, create a function that calls your download script via ajax. Then in the "success" or "done" function, refresh the current page.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
    Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them ( . I did keep the main js functions but made sever…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now