[Vuejs]-Binary data from mongodb gets corrupted

-1👍

the best solution is convert to png or jpg file and upload only path and save image to folder.

-1👍

Here is how I solved it.
I converted from binary to utf8 instead of to base64.

There is a huge difference bewteen
Buffer.from(binary_data, ‘binary’).toString(‘utf8’)

and

Buffer.from(binary_data, ‘binary’).toString(‘base64’)

Leave a comment