AWS S3 - How to fix 'The request signature we calculated does not match the signature' error?

后端 未结 30 2675
谎友^
谎友^ 2020-11-29 08:05

I have searched on the web for over two days now, and probably have looked through most of the online documented scenarios and workarounds, but nothing worked for me so far.

30条回答
  •  鱼传尺愫
    2020-11-29 08:42

    I had the same problem when tried to copy an object with some UTF8 characters. Below is a JS example:

    var s3 = new AWS.S3();
    
    s3.copyObject({
        Bucket: 'somebucket',
        CopySource: 'path/to/Weird_file_name_ðÓpíu.jpg',
        Key: 'destination/key.jpg',
        ACL: 'authenticated-read'
    }, cb);
    

    Solved by encoding the CopySource with encodeURIComponent()

提交回复
热议问题