my $cgi = CGI->new; my $bildid = $cgi->param('picid'); if (defined($bildid) and $bildid =~ /^\d+$/) { $sqlStmtSel = "SELECT DATA FROM BINARY_DATA WHERE ID = ?"; $dbhsrc->{LongReadLen}=150000000; # Make sure buffer is big enough for BLOB $stmtSel = $dbhsrc->prepare($sqlStmtSel) || die "\nPrepare error:$DBI::errstr\n"; $stmtSel = $dbhsrc->execute($bildid) || die "\nPrepare error:$DBI::errstr\n"; # Daten des BLOB lesen my @data = $stmtSel->fetchrow_array; my $BLOB = shift @data; if ($BLOB) { # Bild ausgeben $|=1; print $cgi->header(-type=>"image/jpeg",-charset=>""); binmode(STDOUT); print STDOUT $BLOB; } }