5

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?

enter image description here

enter image description here

4

QGIS (as of version 3.8.0) has no support for binary/bytea fields from Postgres sources. As of version 3.8, they are only supported for disk-based vector layers and in-memory scratch layers.

1

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.

enter image description here

You you use other types of binary data, you have to customize the widgets.

Tested with Geopackage and Postgresql providers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.