我正在开发一个网站,人们可以上传图像,当然他们也可能会上传大量文件,这会耗尽网络应用程序上下文中不需要的云存储空间。因此,我有一个急切的转换集,但它存储原始大小和转换。有没有办法告诉 Cloudinary 只存储转换后的图像?
这是我的代码:
return cloudinary.v2.uploader.upload(data, {
use_filename: true,
unique_filename: false,
folder: body.userId,
eager: { width: 100, height: 100 }
});
});
为了使其正常工作,请使用
transform
属性而不是 eager
。
return cloudinary.v2.uploader.upload(data, {
use_filename: true,
unique_filename: false,
folder: body.userId,
transformation: { width: 100, height: 100 }
});