[thelist] Server Side Includes / Remote host

Diane Soini dianesoini at earthlink.net
Fri Jan 16 20:51:48 CST 2004


If you are doing a get request on an image you are not getting html 
content but the image content. So, if I'm not mistaken, you should have 
something like this:

With a cgi script that returns content type of image/jpg or whatever:
<img src="/cgi-bin/my_script_that_gets_the_image.cgi">

Or something like this with a cgi script that returns content type of 
text/html:
<img src="<!--#include 
virtual="/cgi-bin/my_script_that_returns_a_path_to_an_image.cgi" -->">

Diane

On Friday, January 16, 2004, at 06:00 AM, 
thelist-request at lists.evolt.org wrote:

> #!/usr/bin/perl -w
>
> print "Content-type: text/html\n\n";
> use LWP::Simple;
> $cgiReturn = get http://www.mydomain/ads/ad1.jpg;
> print $cgiReturn;
> exit;
>
> #!/usr/bin/perl -w
>
> print "Content-type: image/jpg\n\n";
> use LWP::Simple;
> $cgiReturn = get http://www.mydomain/ads/ad1.jpg;
> print $cgiReturn;
> exit;
>
> The result, in each case, is a page that pulls in the code of the image
> instead of the image itself.  Any help to get me across the finsh line 
> would
> be greatly appreciated.



More information about the thelist mailing list