I have tried to load a PostGIS layer containing a binary data field (BLOB, bytea) and then use the new form widget for binary fields (https://qgis.org/en/site/forusers/visualchangelog36/index.html#feature-new-form-widget-for-binary-blob-fields). The problem is, that the binary field will not be in the layers attribute table, so the widget can not be used/activated. In the QGIS database manager the field is visible in the table preview. Does anybody knows what is going wrong or what I am missing?
This is possible in QGIS 3.16 (not tested on previous versions).
You can add a
bytea column to your layer and QGIS is able to insert and retrieve the blob (if using Postgresql).
In the following use case, I added a
photo bytea NULL column to my layer to store images.
To configure the feature form, please follow the answer to create either and HTML Widget or QML Widget to see your picture.
Your bytea field will became a Binary Widget and you can use it to upload your binary data.
If you use images, add an HTML Widget or QML Widget to the feature form to display the image, as shown below.
You you use other types of binary data, you have to customize the widgets.
Tested with Geopackage and Postgresql providers.