in reply to Re^2: gnuplot and CGI
in thread gnuplot and CGI
Only the first header is interpreted as a valid header, and hence the browser thinks it is seeing one big text response.print "Content-type: text/plain\n\n"; print p( "A OK" ); print "Content-type: image/png\n\n";
What you must do is send back one response per request. The trick is to set the src attribute of your first response's IMG element in such a way as to cause the client's browser to call your CGI back and ask for the image.
This is the idea:
For a complete example that uses this technique, see the script referenced at the end of The Mobile Weather Problem and its solution on my site.
Cheers,
Tom
Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: gnuplot and CGI
by kryberg (Pilgrim) on Nov 10, 2004 at 13:53 UTC |