• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

When serving a file with CFcontent, all processing stops

Community Beginner ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

I'm creating a PDF with cfpdf, then using cfhttp, cfheader, and cfcontent to open up a save dialog.  How do I get the page to move to another page after the save dialog is shown?  As soon as I add cfcontent to the page, all other processing is stopped (the save dialog pops up, but I can't create a button to move to the next page, or move there automatically).

<cfhttp url="http://XXX.com/#variables.GeneratedPDFName#"

        method="get"

        getAsBinary="yes" />

<cfheader name="Content-Disposition" value="attachment; filename=File.pdf" />

<cfcontent type="application/pdf" variable="#cfhttp.fileContent#" />

Thanks

Views

687

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 24, 2016 Feb 24, 2016

Copy link to clipboard

Copied

LATEST

This is working as expected. The page stops processing because the content-type is changed and you are now streaming a file. The rest of the markup is ignored.

There are a number of pages that give information to this already:

If using CFCONTENT and CFHEADER to stream an Excel file, will Javascript still work?

http://stackoverflow.com/questions/24557322/need-new-page-for-cfcontent-call

Using CFContent's Variable Attribute Stops All Further Processing

Also dont forget the documentation:

Adobe ColdFusion 9 * cfcontent

variable

Optional

Name of a ColdFusion binary variable whose contents can be displayed by the browser, such as the contents of a chart generated by the cfchart tag or a PDF or Excel file retrieved by a cffile action="readBinary" tag. When you use this attribute, any other output on the current CFML page is ignored; only the contents of the file are sent to the client.

etc etc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation