How to handle files using a Lycia web service and save them to the database in a BLOB type field?

LYCIA


Problem

I need to receive images through an input type element contained in an HTML form, process them through a Lycia web service and further save to a database into a BLOB type field.
Once an image is saved to the database, I need to call it back through another web service and send it back to the HTML document to show it in an image tag (<img src=”” alt=”” >).

Solution

There are 2 options:

Both work in LyciaWeb and LyciaDesktop.
Though, to enable file upload/download in Lycia Web, you need to use the TextField with predefined class FileUpload

If UI is coded in other than 4GL language, and 4GL is used for business logic accessed only via WebAPI, the same server program will work. To access blob fields, use /blob URL