Todd Morrison wrote:
Hey Everyone,
I am writing a .pl that will grab an image and store it in an array,
i.e.
open (GIFFILE, $filename)
binmode (GIFFILE);
@fileData = <GIFFILE>;
close (GIFFILE)
Is there a way to "print" the array to an HTML document (i.e. display
the image), at any trivial point in the HTML document's body? Any
advice/pointers would be super-appreciated.
This is very simple. Script for grabing image
----CUT----
# image.pl
my $filename = 'c:/pictures/someimage.gif';
open GIF, $filename;
binmode GIF;
my $image = <GIF>;
close GIF;
# here is the trick how to send image to internet
print "Accept-Ranges: bytes\n",
"Content-Length: ", length($image), "\n",
"Connection: close\n",
"Content-Type: image/gif\n\n",
$image;
----CUT----
And in the html page you will write this
<img src="http://www.somedomain.com/image.pl">
It's all :-)
Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs