Guys, I need to return a json image that comes from the database to be used in VUE. The field in the database is of type IMAGE, which makes everything difficult, as it gives an error in the json return. Is there any way to make this return not give an error?
Error returned:
"InvalidArgumentException
Malformed UTF-8 characters, possibly incorrectly encoded"
Are you storing the image in a blob inside the database?
That is really bad practice, you should store it on the filesystem instead and just store the image path in the database.
I would suggest converting it to base64 before passing it to the client side.
@mauriciolanner If you can't base64 encode the image that is stored in the blob, then you are screwed. You need to convert the binary to text to be able to send it as json.
If you are allowed to change the query in the database you could convert it there