in reply to Inserting binary data into MySQL
You can read a file in fixed-length chunks by setting $/ to a reference to an integer
To reconstruct your file you can either concatenate the blobs in memory, or write them to a file. In either case you need a way to retain their order, which the db can do if you make a column to remember it by. To check that things go ok, all you really need is to set RaiseError in the DBI handle.{ use bytes; local $/ = \1048576; open my $fh, '<', 'bigfile.bin' or die $!; while (<$fh>) { # stuff the db } }
After Compline,
Zaxo
|
|---|