company logo

Binary :: loadFile - Load data from file

The function loads data from a file to the binary data block. When the binary data block already contains data, this will be removed before loading the file.

// load binary data from file to database

... fragment ( Property my_blob ) {

  my_blob.write(Binary().loadFile("image.png"));

}

Return value:  Binary data block handle ( odaba::Binary & )

Constant reference to a binary data block handle, which may contain binary data up to 2 GB.

Implementation details

odaba::Binary & Binary  :: loadFile ( odaba::String &sFilePath )

The function loads data stored in the file referred to via sFilePath to the binary data block. The function throws an exception, when the file path does not refer to a valid file.

  • sFilePath - Complete file path