Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mauriciolanner's avatar

Json return of bank image to vue

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"

0 likes
4 replies
Tray2's avatar

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.

1 like
mauriciolanner's avatar

@Tray2 Yes, I usually do that. But the data I'm fetching comes from another database, legacy system, I can't change it.

Please or to participate in this conversation.