http://qs1969.pair.com?node_id=132034


in reply to How do I display a jpeg in perl to HTML

One note: don't leave blank space above the 'Content-type' header.

Another thing: if your CGI scripts are separate from the HTML (usually they are -- say, ScriptAlias of /cgi-bin and DocumentRoot of /usr/local/apache/htdocs), you have to be careful what "base" the image URL is relative to. You might have to put something like

... <HEAD> <BASE HREF="http://${hostname}${baseurl}"> ...

Replies are listed 'Best First'.
Re: Re: How do I display a jpeg in perl to HTML
by impossiblerobot (Deacon) on Dec 15, 2001 at 03:07 UTC
    To elaborate on what kwoff said:

    Some web servers are set up to attempt to execute any file located in the cgi-bin directory. In that case, you'll have to put any images under your normal HTML directory, then (as kwoff mentioned) reference them in your script from your document root (or with a full URL).

    Impossible Robot