You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Alex Porras <ap...@ena.com> on 2002/01/28 23:09:42 UTC

is there something wrong with my http header?

I'm trying to print a gif image to the browser, but it's appearing as
text.  Here's what the output looks like (used "lynx --mime_header"):

HTTP/1.1 200 OK
Date: Mon, 28 Jan 2002 21:58:05 GMT
Server: Apache/1.3.20 (Unix) mod_perl/1.26
Set-Cookie: FOO=bar; domain=foo.bar; path=/
Pragma: no-cache
Cache-control: no-cache
Connection: close
Content-Type: image/gif
Expires: Mon, 28 Jan 2002 21:58:05 GMT

R0lGODdhOAAWAPcAAAAAAAAAVQAAqgAA/wAkAAAkVQAkqgAk/wBJAABJVQBJqgBJ/wBtAABt
VQBt
...(more data)...


My script does the following:

	$r->no_cache( 1 );
 	$r->content_type('image/gif');
 	$r->send_http_header;
	$r->print( $data );
	$r->exit(OK);

Any thoughts?

TIA,

--Alex

Re: is there something wrong with my http header?

Posted by Robert Landrum <rl...@capitoladvantage.com>.
>I'm trying to print a gif image to the browser, but it's appearing as
>text.  Here's what the output looks like (used "lynx --mime_header"):
>
>HTTP/1.1 200 OK
>Date: Mon, 28 Jan 2002 21:58:05 GMT
>Server: Apache/1.3.20 (Unix) mod_perl/1.26
>Set-Cookie: FOO=bar; domain=foo.bar; path=/
>Pragma: no-cache
>Cache-control: no-cache
>Connection: close
>Content-Type: image/gif
>Expires: Mon, 28 Jan 2002 21:58:05 GMT
>
>R0lGODdhOAAWAPcAAAAAAAAAVQAAqgAA/wAkAAAkVQAkqgAk/wBJAABJVQBJqgBJ/wBtAABt
>VQBt
>...(more data)...
>

Uhh... That's not gif data.  gif data should start

GIF89a...(more data)...

Rob


--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.