You may try this for download any type of file
<code>
//Ns and MSIE need different content type to force download
if(-1 < _request.getHeader("User-Agent").indexOf("MSIE") )
response.setContentType("message/external-body;
access-type=anon-ftp") ;
else
response.setContentType("application/octet-stream") ;
response.setHeader("Content-disposition", "attachment;filename=" +
"yourfilename.ext" ) ;
response.setContentLength(file_to_send.length());
</code>
~boris
"Van Dooren, Damian" wrote:
> I was wondering if anyone knew of a way to get around the following
> situation:
>
> We have a servlet that sends back PDFs that are stored in a database.
> Everything seems to work great but the one oddity/issue that I would like to
> solve if possible is. When someone wants to save the PDF, instead of
> viewing, it wants to save the PDF as the name of the servlet. I understand
> why this is the case, but I wonder if there is anything, perhaps in the
> content header, that I could set the actual name of the file.
>
> Any suggestions would be greatly appreciated.
>
> -----
> Damian Van Dooren
> Information Technology
> The Investment Centre
> (519) 672-4389 x718
>