I have done that some time back but could not get the hands on the code but I wil try to recall.

I had some binary data fields in the database and then used to read the file in the variant and then dump that data into the database.

When retrieveing I just copied the data into the temp file and showed it in the picture box.