IE-SSL download issues


/ Published in: Java
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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);

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.