• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

check if there is a gif viewer

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys:

I have the following problem:
A gif file as InputStream will be fetched from database once
user clicks on image link. Inside my action class,
I want to check if there is a suitable gif file viewer, if
yes, I want to display it.

How can I do it?

thanks a lot
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by a "gif file viewer"?
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean any viewer (browser such as IE, Netscape, etc) that can display
this image. Actually, if I click image link inside IE, it will ask me if
I want to open it or save it. For Netscape, it only allows me to save it.
I need to display it if the browser I am using is capable of doing it.
If not, then save it.

Originally posted by Lasse Koskela:
What do you mean by a "gif file viewer"?

 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about checking whether the HTTP request's "Accept" header includes the string "image/gif"?

Which version of Netscape are you talking about, by the way? You see, I haven't bumbed into a single web browser that doesn't display GIF images (except for Lynx and Links, which are character-based browsers)...
 
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cant understand why you getting the message do you want to save the image instead of displaying it in the browser. Can you check the html code in the page.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you forgotten to set the content-type header to "image/gif" when you write the image content to the ServletOutputStream?
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply:

You are right. I did not make my question clear. Actually, what I wanted
is to display image first. If user can click on an image link, she surely can
display it on the very same browser.
[ May 19, 2004: Message edited by: rick collette ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic