[Xitami] Security for image files for CGI app

Gregory Hart xitami@lists.xitami.org
Wed, 19 Jun 2002 14:37:26 -0700


You could use Perl or another programming language to open the image file, print the content type of the image, print the image, and
then close the file.
An example in perl:
open(IMAGE,"/path_to_images/image.gif");
print "Content-Type: image/gif\n\n";
foreach (<IMAGE>){
    print;
}
close(IMAGE);
-Greg

----- Original Message -----
From: Jeff Hamblin <jphamblin@cox.net>
To: <xitami@lists.xitami.org>
Sent: Wednesday, June 19, 2002 2:23 PM
Subject: [Xitami] Security for image files for CGI app


I'm developing a CGI web server application
that accepts customer orders of customized
items -- basically a fulfillment inventory system.
I authenticate users against a database.

All the webpages are generated from templates
stored outside the website scope, so they are
secure.

One aspect is the display of product thumbnails
and full-size images. Since the client's browser
needs to pull these from the server, they have to
be in the scope of Xitami's website -- rather than the CGI
application -- which makes them accessible via
a direct URL to anyone.

If I protect the product image directory with
Xitami's security then that will require the
user to enter a separate password for the
HTTP/1.0 Basic Authentication protocol, and I
don't want that.

Any suggestions?


-Jeff




--
Xitami Users Mailing List -- For Xitami support
To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami