http.get({ host: "img.php.cn", path: "/upload/avatar/000/001/506/5922afcbb3cf4752.jpg"}, (res)=> { //var stream = fs.createWriteStream("demo.jpg"); //res.pipe(stream); cloud.uploadFile({ cloudPath: 'demo.jpg', fileContent: res, })}); |
云开发中,服务器端api进行cloud.uploadFile 云开发管理后台测试没反应, 写得有错吗?
本地scf 调试 图片可以存本地 但报错:
Error: errCode: -1 unknown error | errMsg: uploadFile:fail Error: missing secretId or secretKey of tencent cloud; at uploadFile api;

遇到和你同样的问题,不知道怎么解决
varresfile = request('https://postimg.aliavv.com/newmbp/6fcr0.png')returncloud.uploadFile({cloudPath:'qcode.png',fileContent: resfile})你这是本地搞得吧。 要在线上才行
本地只是测试能否下载保存图片
云函数 是上传进行测试的,测试不能上传到云开发的文件存储