Thread Binary mit Tk::Photo anzeigen. (13 answers)
Opened by zipster at 2006-06-19 17:19

esskar
 2006-06-20 09:36
#45669 #45669
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
also dann so

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use MIME::Base64 qw(encode_base64);

# ...
if(open(my $img, "< $bild_auswahl")) {  
  binmode $img;

my $bild;
  {
     local $/ = undef;
     $bild = $dbh->quote(encode_base64(<$img>));
  }
  close $img;

  # in datenbank einfügen
  my $sth = $dbh->do("UPDATE kontakte SET bild = $bild WHERE id = $ref_hash_haupt->{'id'}")|| die $DBI::errstr;
} else {
  die "Unable to open $bild_auswahl: $!";
}
# ...
\n\n

<!--EDIT|esskar|1150781932-->

View full thread Binary mit Tk::Photo anzeigen.