The following event handler copies the contents of an image file on disk to a binary field named Mugshot in the current row.

function importImageButton_onClick

   local cFile 

   cFile = getfile( "*.bmp", "Import mugshot image" ) 

   if "" # cFile 

      form.rowset.fields[ "Mugshot" ].replaceFromFile( cFile ) 

   endif