Я загружаю изображения из моего приложения узла в облачный, используя буфер. Я хочу изменить размер этих изображений и загрузить их в облачную систему.
// upload image on cloudinary
cloudinary.v2.uploader
.upload_stream({ resource_type: 'image' }, (error, result) => {
if (error) {
console.log(error);
return;
}
// set this as a product_img in req.body
images.push(result.secure_url);
// if images length equal to files length
// set images on body
if (req.files.length === images.length) {
req.body.images = images;
next();
}
})
.end(file.buffer);