mardi 21 avril 2015

How to handle KeyTooLongError Node.js(AWS)?

I am trying to get some images from my S3 server, but some of them have really large URLs. How could I download those images even with the large URL?

Code:

    //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;
                        }   
}

Debug:

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: false }




Aucun commentaire:

Enregistrer un commentaire