After doing some additional searching, I found out it is not a Struts issue,
but a Tomcat issue.  Specifically, how Tomcat appends cache control headers
when running under a secure context (SSL).

Although this isn't a problem for Safari or Firefox, it is a problem with
Internet Explorer because it prevents the user from downloading
(saving/caching) files via SSL.

See the link below for more information:

http://marc.info/?l=tomcat-user&m=111811136603781&w=2

The solution that worked for me was to add the following response headers in
my action class that extends org.apache.struts.actions.DownloadAction:

response.setHeader("Cache-Control", "cache");
response.setHeader("Pragma", "cache");
response.setHeader("Content-Disposition", "attachment;filename=" +fileName);

My struts-config action looks like this:

<action path="/filetransfer"
type="com.myproject.actions.SSLFileDownloadAction"/>

My struts link looks like this:

<html:link action="filetransfer?file=myPDF.pdf">My PDF</html:link>

Some great examples of how to implement the struts download action can be
found here:

http://wiki.apache.org/struts/StrutsFileDownload

Thanks for the suggestions/help.

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2008 7:56 PM
To: Struts Users Mailing List
Subject: Re: Download PDF File in Internet Explorer w/SSL

On Sat, Oct 18, 2008 at 5:06 PM, gcj <[EMAIL PROTECTED]> wrote:

> Despite the numerous posts/suggestions I have read/implemented on the
> subject, I am not able to download or display existing PDF files from my
SSL
> struts/tomcat application using Internet Explorer.

What did you do, and what happened?  Without a description of the
error it's hard to help.

Your post initially reminded me of a problem I had long ago serving PDFs...

Internet Explorer has a problem displaying non-HTML content over SSL
as the result of a form POST.  In short, you have to send IE some HTML
before you send it the bytes of the PDF, or it will complain.

If that sounds like it, I have a very old wiki page on the topic...
http://wiki.wsmoak.net/cgi-bin/wiki.pl?NonsecureContent

(But then later you say a plain link didn't work either, so maybe not.)

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to