[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jetspeed-user
Subject:    Re: https, jetspeed and turbine RawScreen's...
From:       Michael Sallman <msallman () pro-ns ! net>
Date:       2001-12-20 0:59:19
[Download RAW message or body]

Chris,

>Chris Kimpton wrote:
> 
> Could you provide some more detail on this solution, this seems like
> it might be my best option...
> 

I had to go back and look to see how I did it, it's been so long. :-)
I have a page that sends a request to a Turbine Screen, which returns a
PDF document based on parameters passed from the original page. The
checkbox sets the parameter "download".
If download is true, the content type gets set to a non-standard type,
and with that and no file extension for IE/Windows to use to try and
figure out the file type, IE is forced to download the file. 
Looking at my code (at the end of this email), I also seem to recall
that there was a problem with cacheing/not cacheing (which is why I
commented it out, I think).
Anyway, it seems to do the trick.

>I found out last night that I had the IE Security option "Do not save
>encrypted pages to disk" switched off - which I don't think is the
>default.  This seemed to allow the access to work in some cases. 
>Turning this on meant that even my standalone servlet no longer
>worked....

Yep, I could get it to work some of the time (just not 100% of the
time), which is why I didn't resort to some browser-detection script. I
figured I'd let them try it and if their configuration let them display
the PDF in IE, great. If not, then they could download it and open it up
themselves in Acrobat. Or use a different browser!

The Screen does:

	String download = data.getRequest().getParameter("download");
        String stmttype = data.getRequest().getParameter("type");
        if (stmttype == null || stmttype.equals("")) stmttype = "pdf";
 
        filename = filedir + aid + "." + stmttype;
        stmtfile = new File(filename);
        j = (int)stmtfile.length();
        filearray = new char[j];
 
        java.io.BufferedReader br = new java.io.BufferedReader(new   	
java.io.FileReader(filename));
        br.read(filearray);
          
        //data.getResponse().setHeader("Cache-Control", "no-store");
        //data.getResponse().setHeader("Pragma", "no-cache");
            
        if (download.equals("true")) 
	{
           data.getResponse().setContentType("application/fidelity");
        } else  data.getResponse().setContentType("application/pdf");


Mike

--
To unsubscribe, e-mail:   <mailto:jetspeed-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic