Mike Tinnes wrote:
>
> Hello everyone. I need a jsp which downloads a serverside image to a client and
>instead of simply displaying the image in the browser, I'd like it to popup a save-as
>dialog. I've read a few posts on a similar subject, but I can't get anything to work
>the way I need it to. I've tried the following in my response code...
>
> response.setContentType("image/gif");
> response.setContentLength((int) f.length());
> response.setHeader("Content-disposition","attachement; filename=test.gif");
>
> This displays the image in the browser as usual, but does use 'test.gif' for saving.
>Do I need some special mime type?
>
> TIA, Mike
>
I think you need to change the content type - once a browser sees
"image/gif" it is going to display.
Try response.setContentType("application/octet-stream");
so the browser won't jump to conclusions.
--
WBB - [EMAIL PROTECTED]
Java Cert mock exams http://www.lanw.com/java/javacert/
Author of Java Developer's Guide to Servlets and JSP
ISBN 0-7821-2809-2
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]