tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Einfeldt" <ralph.einfe...@uptime-isc.de>
Subject RE: Stream PDF using servlet
Date Thu, 24 Apr 2003 15:22:13 GMT
There are following recommendations:
- Use an url that ends with the extension pdf
- Use content disposition that ends with the extension pdf
  (does f.getName() return somthing with *.pdf ?)
- Set the content type

In the age of safty belts and airbags I tend to use all
of them and have no trouble with it. (We also don't set 
any cache or proxy headers, but that was for a different 
reason.)

> -----Original Message-----
> From: harm@informatiefabriek.nl [mailto:harm@informatiefabriek.nl]
> Sent: Thursday, April 24, 2003 5:13 PM
> To: Tomcat Users List
> Cc: Tomcat Users List
> Subject: Re: Stream PDF using servlet
> 
> 
> I have the same problem....
> 
> response.setContentType("application/pdf");
> response.setContentLength((int) f.length());
>  
> response.setHeader("Cache-Control", "no-cache");
> response.addHeader("Content-disposition",
>                           "attachment; filename=" +
>                                   f.getName());

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message