I've done as suggested and it works fine in Mozilla but IE won't display the
image:

http://cgi.www.miswebdesign.com/cgi-bin/www.miswebdesign.com/logo.pl?image=l
ogo

Any ideas?

Cheers,
Nigel

Script:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=
#!/bin/perl5.6.0

use CGI;
use File::Slurp;

my $q = new CGI;
my $url = '/docs/www.miswebdesign.com';

my $logo = '/images/logo.jpg';

my $location = $url . $logo;

print "Cache-Control: no-cache\n";
print "Expires: Thu, 01 Dec 1994 16:00:00 GMT\n";
print "Last-Modified: Thu, 27 Feb 2003 15:12:07 GMT\n";
print "Content-type: image/jpg\n";
print "ETag: \"518394-1a79-3e5e2ac7\"\n";
print "Accept-Ranges: bytes\n";
print "Content-Length: 6777\n\n";

print read_file($location);
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=

> -----Original Message-----
> From: Dan Muey [mailto:[EMAIL PROTECTED]
> Sent: 28 February 2003 14:43
> To: Nigel Peck - MIS Web Design; [EMAIL PROTECTED]
> Subject: RE: Delivering Graphics over HTTP
>
>
> I assume what you're trying to do is have in your html
> <img src="image.cgi">
>
> And maybe except paramkaters and display accordingly?
>
> If so all you need to remember is to print the proper headers and
> don't try to print and text.
>
> #!/usr/bin/perl
>
> use File::Slurp;
> use CGI qw/:standard/;
>
> print header("image/gif");
> print read_file("/path/to/img.gif");
>
>
> Of course you can do all kinds of things like check for
> errors modify the images using various image modules display
> different images based on inout, etc, etc
>
> DMuey
>
> >
> > I need to deliver graphic files (jpg and gif) over http in
> > the same manner that a web server would. Can anyone point me
> > in the right direction? Setting the mime type is no problem
> > but it's the rest that I have no experience of. In the past
> > I've always simply done a location: /path/to/graphic but the
> > graphics are getting cached somewhere along the line so I need to set
> > Cache-control: no-cache and the only way I can think of to do
> > this is if my script does the delivery itself.
> >
> > I don't have access to the configuration of the web server.
> > Unless it possible to do it in .htaccess?
> >
> > I tried the following in .htaccess but no joy, is there a
> > better way of doing this with .htaccess? Possibly at HTTP 1.0
> > server somewhere in the chain is preventing it from working?
> >
> > <Files ~ "logo\.jpg$">
> >   Header add Cache-Control "no-cache"
> > </Files>
> >
> > <Files ~ "logo2\.jpg$">
> >   Header add Cache-Control "no-cache"
> > </Files>
> >
> > TIA
> >
> > Nigel
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to