You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Differentiated Software Solutions Pvt. Ltd" <di...@vsnl.com> on 2000/07/13 11:36:26 UTC

Returning a GIF without Location

Hi,

We have a mod_perl program which based on certain parameters returns the gif which is to be displayed. We use 
print "Location: http://192.168.1.2/smg/images/logo.gif'". 
This means the browser makes 2 HTTP requests
1. To the CGI program to request for the location of the GIF
2. To the Web server requesting the GIF itself.

We want to combine both into a single HTTP - request response sequence i.e., is it possible to read and return the gif file from within a CGI program itself. If so, how ??

Thanks for the help.

Regards,

S Muthu Ganesh

Differentiated Software Solutions Pvt. Ltd.
176, Ground Floor, 6th Main,
2nd Block, RT Nagar
Bangalore - 560032
Phone : 91 80 3431470
www.diffs-india.com

Re: Returning a GIF without Location

Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "DSSPL" == Differentiated Software Solutions Pvt Ltd <di...@vsnl.com> writes:

DSSPL> We want to combine both into a single HTTP - request response
DSSPL> sequence i.e., is it possible to read and return the gif file
DSSPL> from within a CGI program itself. If so, how ??

It most certainly is not mod_perl specific, but you just return a
content type of image/gif and then the data of your image.  It doesn't
even have to be a file; it can be dynamically generated.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-301-545-6996
GPG & MIME spoken here            http://www.khera.org/~vivek/

Re: Returning a GIF without Location

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 13 Jul 2000, Differentiated Software Solutions Pvt. Ltd wrote:

> Hi,
> 
> We have a mod_perl program which based on certain parameters returns the gif which is to be displayed. We use 
> print "Location: http://192.168.1.2/smg/images/logo.gif'". 
> This means the browser makes 2 HTTP requests
> 1. To the CGI program to request for the location of the GIF
> 2. To the Web server requesting the GIF itself.
> 
> We want to combine both into a single HTTP - request response sequence
> i.e., is it possible to read and return the gif file from within a CGI
> program itself. If so, how ??

Apache->request->internal_redirect(<url>);

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org