Thanks for the responses.

When I serve up a pdf file with the code below, it shows it in an embedded 
acrobat, as desired. However, the icon in the browser (in the tab) is the 
Tomcat logo.

I'd like to change it to something else.

----- Original Message ----
From: Pid <p...@pidster.com>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Tue, July 6, 2010 1:10:08 PM
Subject: Re: favicon when serving non-html

On 06/07/2010 15:10, Dola Woolfe wrote:
> Hi,
> 
> When I serve up, say, a PDF file, how do I control the favicon?
> 
> Here's my code:
> 
> 
>    response.reset();
>     response.setContentType(IOUtilities.gMIMEType(fn));
>     response.setHeader("Content-disposition", "inline; filename=" + 
> file.getName());
>     OutputStream outStream = response.getOutputStream();
>     synchronized(response.getOutputStream()){
>       outStream.write(IOUtilities.gFile2Bytes(file.getAbsolutePath()));
>     }
>     response.flushBuffer();
> 
> Thanks in advance

If you mean "How do I specify which icon will be associated with a file
that I make available for download?"

You can't - the OS will always be able to override it.

The best you can do is present a recognisable MIME type in the
"setContentType" method call.  You're using another class there, so I
can't see what you're actually setting.  Do you know what is sent?


p


P.S. please note the following:

- It's "Tomcat", not "Tom Cat".

- The mailing list is now "users@tomcat.apache.org" not
"tomcat-u...@jakarta.apache.org".


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to