云函数使用uploadFile上传比较大的图片(base64)时,会失败怎么办呢?
如题,云函数使用uploadFile上传比较大的图片(特别是用苹果手机拍出来的照片),上传会失败,云函数代码见下方。 请问大佬们,①上传图片比较好的方法是什么呢?②如果还是使用我这种方法,怎么有效的压缩图片不影响图片质量还能完成上传呢? 感谢感谢! 云函数:exports.main = async (event, context) => { try { return await cloud.uploadFile({ cloudPath: event.path, fileContent: new Buffer(event.file, 'base64') }) } catch (e) { return e; } }