gpt4 book ai didi

javascript - 在 SIRV S3 NodeJ 中的文件夹之间移动图像

转载 作者:太空宇宙 更新时间:2023-11-03 22:19:26 25 4
gpt4 key购买 nike

我正在开发一个项目,我应该在 SIRV S3 的其他文件夹中复制一些图像。

我正在使用此代码,它适用于我的大部分图片:

    const options = {
method: 'GET',
url: photoUrl,
encoding: null,
headers: {
'Authorization': req.headers.token
}
}
return request(options).then(data => {
const params = {
Bucket: sirvS3Bucket,
Key: uploadPath + '/' +fileName,
Body: data
};
return s3.upload(params, function (s3Err, data) {
if (s3Err) {
console.log('s3 error' + s3Err);
}
});
}).catch(error => {
console.log('\n[Pictures 96]: ' + error + '\n');
});

但我遇到一些图片问题:

状态代码错误:400 - {“类型”:“缓冲区”,“数据”:[60,104,116,109,108,62,10,32,32,60,104,101,97,100,62,10,32,32,32,32,60,109,101,116,97 ,32,99,104,97,114,115,101,116,61,39,117,116,102,45,56,39,62,32,10,32,32,32,32,60,116,105,116,108,101,62,69,114,114,111,11 4,58,32,70,97,105,108,101,100,32,116,111,32,100,101,99,111,100,101 ,32,112,97,114,97,109,32,38,35,51,57,59,47,99,117,114,114,121,47,53,97,56,49,100,53,48,100,48,53,55,51,56,100,51,100,48 ,48,48,49,49,56,102,56,47,118,101,108,111,117,116,37,69,57,37,50,48,99,104,111,117,120,37,50,48,102,108,101,117,114,37,50 ,48,110,111,105,115,101,116,116,101,95,79,75,46,106,112,103,45 ,49,53,56,49,56,54,48,56,50,51,52,53,50,46,106,112,103,38,35,51,57,59,60,47,116,105,116,108,101,62,10,32,32 ,32,32,60,115,116,121,108,101,62,42,32,123,10,32,32,109,97,114,103,105,110,58,32,48,59,10,32,32,112,97,100,100,105,110,10 3,58,32,48,59,10,32,32,111,117,116,108,105,110,101 ,58,32,48,59,10,125,10,10,98,111,100,121,32,123,10,32,32,112,97,100,100,105,110,103,58,32,56,48,112,120,32,49,48,48,112,1 20,59,10,32,32,102,111,110,116 ,58,32,49,51,112,120,32,34,72,101,108,118,101,116,105,99,97,32,78,101,117,101,34,44,32,34,76,117,99,105,100,97,32,71,114, 97,110,100,101,...

有谁知道为什么我只在某些图片上遇到这个问题?

谢谢

最佳答案

所以我通过使用 http.get 而不是 request 来纠正这个问题

关于javascript - 在 SIRV S3 NodeJ 中的文件夹之间移动图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60249469/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com