0

I want a solution, MY problem is i have to show one pdf file.And when i save this file it should be save by a name which is comming from request.getSession().getAttribute(Constants.Q_NO).I used following code .It is working for all browsers except ie8. when i execute my code in ie8 and press ..pdf button, it open pdf file but when i try to save this file it save with a different name(name in my url like xyzController.pdf).I want it save with a name which is comming by a code request.getSession().getAttribute(Constants.Q_NO). So what a need to change and modify that it work for ie8 also.I read many senario for that but all are using attachment, in my senarion the requirement is different. The code is below :

       response.setContentType("application/pdf");
            response.setHeader("Pragma", Constants.PUBLIC);
            response.setHeader("Cache-Control", Constants.PUBLIC);
            response.setHeader("Content-disposition",
         "filename="+ request.getSession().getAttribute(Constants.Q_NO));
            System.out.println( request.getSession().getAttribute(Constants.QUOTE_NUMBER));
            out.write(data);
            out.flush();
Saakshi Aggarwal
  • 528
  • 1
  • 11
  • 26

1 Answers1

0

Your problem seems to be more with IE8 and it way to read the response header than with your java code. Maybe this could help you (even if it's another language) : Why doesn't Content-Disposition header work in IE 8?

Community
  • 1
  • 1
Jib'z
  • 953
  • 1
  • 12
  • 23
  • when i use attachment in header it work fine.it give correct name of file. But my requirement is different. I need to first open it in another window. inline also not working. plz suggest more solution – Saakshi Aggarwal Aug 31 '15 at 11:23