http://www.perlmonks.org?node_id=403073


in reply to How to display the response from a get request to a browser?

You need to return 'Content-type: image/jpeg' in your headers. Some clients will break with your Content-Length: 0 as well.

If you use CGI; it can help make alot of these tasks easier, but content-type is what you need to fix this problem. Text works fine because text/html is the browser's default.

HTH

Replies are listed 'Best First'.
Re^2: How to display the response from a get request to a browser?
by elwarren (Priest) on Oct 27, 2004 at 16:12 UTC
    Nevermind, I just realized this is client-side, not server-side.

    If your goal is just to display images from webservers, you might want to check out the feh tool. It kicks the butt of display. You can point it at a url and it will handle all of the download and display. It also has a param to automatically refresh/reload after x seconds. I use it to fullscreen a remote webcam on my setup at home and it's brilliant.

    HTHM
      ok, I went the feh website and downloaded the first one in the download list:
      Get feh-1.2.7.tar.gz here.
      now, where should I put the downloaded .tar file.
      and how do I use it the perl code.

      do I store the resulted set of charatere in a file and pass it the feh or what. Thank you for the effort.
      unb