Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / January 2008



Tip: Looking for answers? Try searching our database.

CF8 - Ajax Form Post and Document Type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tSpark - 07 Dec 2007 01:24 GMT
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?
GArlington - 07 Dec 2007 10:42 GMT
> 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
[quoted text clipped - 21 lines]
>  Why can't the Ajax call made by the CFDIV functionality deliver a PDF or other
> file?

In order for your pdf plug-in to open the document and display pdf
file (and not the code that you get) it needs to receive the
contenttype="application/pdf" in the document header. There can be
only one document header per page -> you can not display html AND
excel AND pdf all in one page. <iframe ... /> is probably your only
option here...
mostlySimple - 31 Jan 2008 04:16 GMT
I'm having the same problem...
mostlySimple - 31 Jan 2008 04:18 GMT
I'm having the same problem...
mostlySimple - 31 Jan 2008 04:18 GMT
I'm having the same problem...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.