1

I wrote a server like this: Link

My upload script looks like (onpage script):

var uploader = new qq.s3.FineUploader({
        element: document.getElementById("fineUploader"),
        request: {
            endpoint: "bucket.s3-eu-central-1.amazonaws.com",
            accessKey: "accesskey",
        },
        signature: {
            version: 4,
            region: "eu-central-1",
            endpoint: "https:127.0.0.1:8000/s3handler"
        },
        retry: {
            enableAuto: false
        },
        chunking: {
            enabled: true
        },
        paste: {
            targetElement: document,
            promptForName: true
        }
    });

I get the credentials, after upload I get the error message:

the region 'us-east-1' is wrong; expecting 'eu-central-1'

At the Node Server is the x-amz-credential returns also at region us-east

vaildkey/vailduntil/us-east-1/s3/aws4_request

But I added already at the client (see first code) region to the signature. Also I added to the expectedHostname the same link as endpoint at the top, and start the server with aws.config.region='eu-central-1';

What did I make wrong that the region does not changes?

1
  • As workaround, I created a second bucket in region us-east-1, after this change, it works. But what is the bug? Commented May 3, 2017 at 11:46

1 Answer 1

1

Per the Fine Uploader docs, you'll want to set a top-level property called objectProperties containing your region (it defaults to us-east-1, which is why creating your bucket in that region works).

Your uploader script would thus look like this:

var uploader = new qq.s3.FineUploader({
    element: document.getElementById("fineUploader"),
    objectProperties: {
        region: "eu-central-1"
    },
    request: {
        endpoint: "bucket.s3-eu-central-1.amazonaws.com",
        accessKey: "accesskey",
    },
    signature: {
        version: 4,
        endpoint: "https:127.0.0.1:8000/s3handler"
    },
    retry: {
        enableAuto: false
    },
    chunking: {
        enabled: true
    },
    paste: {
        targetElement: document,
        promptForName: true
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.