How do I get a save/download window using Ajax?

2010-12-27 Thread marc --
Hi, I have a page with a print button. When I click that button, a pdf is generated by CF and sent to the client using cfdocument, mime-type application/pdf and a header content-disposition so that the pdf is treated as an atachment. That works fine if I don't use Ajax. But I can't get this

How do I get a save/download window using Ajax?

2010-12-27 Thread marc --
Hi, I have a page with a print button. When I click that button, a pdf is generated by CF and sent to the client using cfdocument, mime-type application/pdf and a header content-disposition so that the pdf is treated as an atachment. That works fine if I don't use Ajax. But I can't get this

Re: How do I get a save/download window using Ajax?

2010-12-27 Thread marc --
I just see that the Ajax call is getting the pdf data - if I do an alert(data) in the onSucess callback I get the binary data. Question is how to display this binary data ~| Order the Adobe Coldfusion Anthology now!

Re: How do I get a save/download window using Ajax?

2010-12-27 Thread Raymond Camden
I don't believe what you want to do is possible. A plugin is used to display PDF data. You can't simply tell the plugin to render arbitrary binary data via JS. I'd recommend modifying your JS so that it moves the window to a location (new url) that serves up the PDF. On Mon, Dec 27, 2010 at 4:56

Re: How do I get a save/download window using Ajax?

2010-12-27 Thread Dan G. Switzer, II
You can't download files like that via AJAX. What you can do, and what I've done in the past, is use an iframe to push the download to the browser. In the past I've used AJAX to check the server to see if the downloadable file is ready for download. I do this by creating a unique download token