小编Dan*_*ira的帖子

如何处理 KeyTooLongError Node.js(AWS)?

我试图从我的 S3 服务器获取一些图像,但其中一些具有非常大的 URL。即使 URL 很大,我如何下载这些图像?

代码:

//download the object from the bucket
sourceS3.getObject(getparamsOrig, function(gerr, s3obj) {
    if (gerr) {
        //if there is problem just print to console and move on.
        console.log('Download issue');
        console.log(gerr);
        return;
    }   
});
Run Code Online (Sandbox Code Playgroud)

调试:

DEBUG [03314cb6]    Download issue
DEBUG [03314cb6]    { [KeyTooLongError: Your key is too long]
DEBUG [03314cb6]      message: 'Your key is too long',
DEBUG [03314cb6]      code: 'KeyTooLongError',
DEBUG [03314cb6]      time: Tue Apr 21 2015 17:10:51 GMT-0400 (EDT),
DEBUG [03314cb6]      statusCode: 400,
DEBUG [03314cb6]      retryable: …
Run Code Online (Sandbox Code Playgroud)

javascript amazon-s3 amazon-web-services node.js

6
推荐指数
0
解决办法
849
查看次数