Re: Returning image/gif Content-type

Nigel Metheringham (
Thu, 06 Feb 1997 11:10:32 +0000

Message-Id: <>
From: Nigel Metheringham <>
Subject: Re: Returning image/gif Content-type 
In-Reply-To: Your message of "Thu, 06 Feb 1997 10:30:16 +0100."
Date: Thu, 06 Feb 1997 11:10:32 +0000

} I was trying to write a little fcgi app last night which returned a gif
} created on the fly using the gd library. I figured that I'd just need to
} put out a content type header of image/gif, then write the gif to
} stdout. However, this doesn't seem to have worked - the error logs on
} the web server suggest a malformed content type header. Has anyone else
} tried something like this and got it working? I checked the list
} archive, and someone asked the same question a while back but got no
} answer.

getting gd to write stdout is a bit of a problem - basically it needs to 
fork and do things that way (seemed odd to me too!).  I expect the data 
packaging for the multiplexed FCGI output stream is getting all mixed up 
because of this.

Try getting gd to write the gif to a temp file (which it does without 
forking), then open and read that temp file, writing the data down the 
output, finally unlinking the temp file.


[   - Unix Applications Engineer ]
[ *Views expressed here are personal and not supported by PLAnet* ]
[ PLAnet Online : The White House          Tel : +44 113 251 6012 ]
[ Melbourne Street, Leeds LS2 7PS UK.      Fax : +44 113 2345656  ]
[Q: You know when you run sendmail....  A: No, you DELETE sendmail]