Posted By

arunpjohny on 02/01/11


Tagged

ie-ssl ssl-download attachment-download


Versions (?)

IE-SSL download issues


 / Published in: Java
 

URL: http://geekcredential.wordpress.com/2009/04/21/grails-file-serving-controller-and-tomcat-ssl-problem/

When downloading a file using SSL, IE throws an exception if the Prgama header is set as no- cache. When we uses Apache Tomcat with security-constraint CONFIDENTIAL if the cache control headers(Cache-Control and Pragma) are not present in the response, Tomcat will add them. This will fail in IE. So we need to manually set the cache control values in the servlet itself

  1. response.setContentType(contentType);
  2. response.setHeader("Content-Disposition", "Attachment;Filename=\"" + fileName + "\"");
  3. response.setHeader("Cache-Control", "private, max-age=5");
  4. response.setHeader("Pragma", "");
  5. response.setContentLength(length);

Report this snippet  

You need to login to post a comment.