Hallo all.
I need to contact a server side component sending some parameters and
open on the user browser the dialog box for opening or saving the
file.
The file that the server side component creates is a PDF.

So i create clien side this function that contacts the requested url:

executePostAction: function(url) {
                    if (url != undefined) {
                        jQuery('<form id="postAction" action="'+ url +'"
method=post></form>').appendTo('body');
                        jQuery("#postAction").submit().remove();
                    }
                },

and this is the code where i call the function

jQuery.executePostAction('/script/PDFServlet');

Everithing works great on all browsers except ie6 (grrrr damned bill &
steve).

Anyway I tried to get the file via ajax call in this way

jQuery.ajax({
                                async: false,
                                url: "/script/PDFServlet",
                                type: "POST",
                                success: function(data){
                                        alert(data);
                                },
                                error:function(msg) {
                                        alert(msg);
                                }
                        });

And the file is downloaded and prompted at the user as toString of the
binary.

Server side the servlet creates the header response this way

   response.setContentType("application/pdf");
   response.setHeader("Cache-Control", "cache");
   response.setHeader("Pragma", "cache");
   response.setHeader("Content-Disposition",
"attachment;filename=document.pdf");

Any idea how to fix this problem on ie6?

Kind regards

Massimo

Reply via email to