on mouseup
put "*.jpg;*.gif;*.png" into types
if there is not an image "photo" then
create image "photo"
end if
answer file "Select file" with type types
if it is empty then exit mouseUp
put it into fn
if there is a file fn then
set the fileName of image "photo" to fn
end mouseup
on mouseup
## type is a reserved word!
put "*.jpg;*.gif;*.png" into tTypes
if there is not an image "photo" then
create image "photo"
end if
answer file "Select file" with type tTypes
if it is empty then
exit mouseUp
end if
put it into fn
##if there is a file fn then
## User HAS in fact selected a file! ;-)
set the fileName of image "photo" to fn
## end if
## put binary image data into variable
put url("binfile:" & fn) into MyImageVar
revExecuteSQL Your_DB_ID_here, "insert into YourTable(YourLargeBlobDBField) values(:1)", "*bMyImageVar"
## the *b before the variable name indicates that you are passing binary data to the db.
## if the result...
## errorchecking here...
end mouseup