
June 27th, 2000, 11:04 AM
|
 |
Contributing User
|
|
Join Date: Jun 2000
Location: Southern California
Posts: 73
Time spent in forums: 56 m 9 sec
Reputation Power: 13
|
|
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by chinnavi:
I want to read full image into a variable.
i used this code
open(GIF,"a.gif");
$giffile = <GIF>;
close(GIF);
but the problem is it reads only "one line" of GIF file ....
[/quote]
Try this:
$path = '/path/to/a.gif';
$len = -s $path;
open FH, $path or die "cannot open $path: $!n";
$bytesread = read(FH,$buffer,$len);
die "read errorn" unless $bytesread == $len;
close FH;
now you can insert $buffer into your table...
[This message has been edited by vpopper (edited June 27, 2000).]
|