Reputation: 175
I'm using the Multer library to upload an image. So, I use ReactJS to upload the file to the NodeJS server. In the NodeJS server, I received a piece of image information sent from the client as this picture.
In the s3 upload function, I use the buffer value in this picture as a body. I uploaded it to s3 successfully but when I open the image URL, it shows me like this picture.
There's any suggestion or correct way to upload an image to S3.
Upvotes: 2
Views: 1473
Reputation: 665
I would suggest you to use base64
encoding, 7bit
enconding won't work for images as you are trying to do.
You can read more about that in this StackOverflow answer: https://stackoverflow.com/a/28531705/6334411
Upvotes: 1