in reply to storing files with dbi & sqlserver

MS SQL has some different BLOB types, such as IMAGE, TEXT and NTEXT, which you can use according to your needs.

As for inserting them into the database, you may use the same upload subroutine that you saw in my node about BLOBs, without the stuff about max length.

However, be aware that inserting large objects in a database through DBI may be tricky. Check the DBI documentation about LongReadLen and LongTruncOK before attempting to achieve your goal.

That aside, retrieving variables from BLOBs is not different from other types.

# --- untested --- $dbh->LongReadLen = 100 * 1024; # 100 KB $dbh->LongTruncOK =0; # will fail if the column is too big my $sth = $dbh->prepare(qq{select image from table where id= ? }); my $image = undef; $sth->execute(1); my $record = $sth->fetchrow_hashref(); $image = $record->{"image"}; $sth->finish;

HTH

_ _ _ _ (_|| | |(_|>< _|