Hi,
I'm trying to upload images to server.
The request works well, but the body are buffered.
What can i do to get real data from body buffered?
I tried Buffer.from(req.body, 'utf8'), but it wrong converts the image.
"Input buffer contains unsupported image format"
Angular 14.
Insert Image Settings:
Front Events:
Backend:
newBuffer = image buffer
"Input buffer contains unsupported image format"
Hello Vinitha,
sorry for my english.
I'm using rich text editor in my web aplication. I need to save the image in our AWS server and replace the generated URL on HTML text, making HTML size smaller.
The HTML will be use in our FAQ texts.
So i configured the saveUrl​ passing the backend save route:
Before upload the image, we check size and set on currentRequest the authorization to execute saveUrl.
In backend, i need to process the image, getting the buffer from rich text save url request and converting to WEBP, using the module "sharp".
So, first, we're using "parse-multipart" module to parse the request body.
After getting the parts, we convert the image, using the "sharp" module, to WEBP image.
After upload imagem success, replace URL generated in HTML text:
Running localy, front-end and back-end, works well, using latin1 to get buffer data.