For the way to store the files in the database:
- write the image to disk
- use fileReadEx() to read it from disk into a blob variable in powerbuilder
- INSERT a new record in a table with a field of type CLOB / Binary / Long binary / etc. (depends on your DB provider)
- Use the UPDATEBLOB command in PB to assign the blob variable to it's corresponding field in the DB table.
You can also NOT write the file to disk and store the image directly as a blob into the database, but then you'll miss important file header information, which you'd need to view the image with any program. So I advice to always first write the image to disk, then insert into the database and if you don't want to keep the image on disk, delete the file from disk.