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

CF8 - Ajax Form Post and Document Type

Explorer ,
Dec 06, 2007 Dec 06, 2007

Copy link to clipboard

Copied

I'm having a problem trying to figure out how to get a form post to return a PDF document using CF8. I can't seem to get CFDOCUMENT to deliver a PDF through the form.

I have a form inside a CFDIV...

<cfdiv id="mydiv">
<cfform action="myscript.cfm" method="post">
a bunch of input fields, then...
<input type="submit" value="Generate PDF" />
</cfform>
</cfdiv>

On submit, the form makes an Ajax call sending the data to a script that generates a PDF using CFDOCUMENT and delivers it through the browser.

However, it is not delivering the PDF. Instead, it is delivering the CODE for the PDF into the CFDIV and trying to display the code. I tried the same form delivering an Excel file with cfcontent and cfheader. It delivers the code instead of the actual document.

If I take this form out of the CFDIV, everything works great.

Why can't the Ajax call made by the CFDIV functionality deliver a PDF or other file?
TOPICS
Advanced techniques

Views

852

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
New Here ,
Jan 30, 2008 Jan 30, 2008

Copy link to clipboard

Copied

I'm having the same problem...

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
New Here ,
Jan 30, 2008 Jan 30, 2008

Copy link to clipboard

Copied

I'm having the same problem...

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
New Here ,
Jan 30, 2008 Jan 30, 2008

Copy link to clipboard

Copied

I'm having the same problem...

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
LEGEND ,
Jan 30, 2008 Jan 30, 2008

Copy link to clipboard

Copied

I'm having the same problem...

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
Guest
Mar 17, 2009 Mar 17, 2009

Copy link to clipboard

Copied

I'm having the same problems over two years later. CFCONTENT doesn't work as documented when you call it from within an AJAX app. My workarounds that call the code from another directory are way too kludgey for the client, but proved my standard code works outside of AJAX layout areas. I'm specifically trying to do what tSpark also mentioned, that is generate an Excel spreadsheet from query results displayed in an HTML table.

Has anyone solved this problem?



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
Explorer ,
Mar 17, 2009 Mar 17, 2009

Copy link to clipboard

Copied

LATEST

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