# Aws S3 getUploadParameters help

**URL:** <https://community.transloadit.com/t/aws-s3-getuploadparameters-help/15061>\
**Category:** Uppy\
**Created:** [September 17, 2019, 3:30pm UTC](https://community.transloadit.com/t/aws-s3-getuploadparameters-help/15061 "2019-09-17T15:30:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![weiiew](https://avatars.discourse-cdn.com/v4/letter/w/82dd89/32.png) [@weiiew](https://community.transloadit.com/u/weiiew)\
**Post date:** [September 17, 2019, 3:30pm UTC](https://community.transloadit.com/t/aws-s3-getuploadparameters-help/15061/1 "2019-09-17T15:30:58Z")

</div>

Hi,

I’m trying to get AwsS3 working with getUploadParameters in React + Node.js. I’m not sure what I am doing wrong, but I keep running into the error:

```auto
AwsS3: got incorrect result from 'getUploadParameters()' for file '24px.png', expected an object '{ url, method, fields, headers }'.

```

I have looked at this issue: [https://github.com/transloadit/uppy/issues/819](https://github.com/transloadit/uppy/issues/819) but I still seem to be getting this error.  
My front-end code:

```auto
Uppy()
                .use(AwsS3, {
                    getUploadParameters(file) {
                        axios.get('/api/aws/signUrl/put', {
                            params: {
                                fileName: file.name,
                                contentType: file.type,
                                bucket: props.bucket,
                                directory: 'test'
                            }
                        })
                            .then((result) => {
                                console.log(result.data)
                                return {
                                    url: result.data.url,
                                    method: result.data.method,
                                    fields: result.data.fields,
                                    headers: {}
                                }
                            })
                            .catch((err) => {
                                console.log(err.response)
                            })
                    }
                })

```

my back-end code:

```auto
router.get('/signUrl/put', function (req, res, next) {
    console.log('hi')
    const key = `${req.query.directory}/${shortid.generate()}` // for the chat, it will be the participant_id
    s3.getSignedUrl('putObject', {
        Bucket: req.query.bucket,
        Key: key,
        Expires: 180,
        ContentType: req.query.contentType,
        Metadata: {
            fileName: req.query.fileName,
        }
    }, (err, url) => {
        if (err) {
            console.log(err)
            res.status(500).json('Internal server error')
        } else {
            res.status(200).json({ url: url, key: key, method: 'put', fields: {} })
        }
    })
})

```

my console.log of my `console.log(result.data)` looks good, but i still seem to be getting this error.

```auto
fields: {}
key: "test/9QJJEP0uy"
method: "put"
url: "https://mybucketname.s3.amazonaws.com/test/9QJJEP0uy?Content-Type=image%2Fpng&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=MYCREDENTIALS&us-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190917T152817Z&X-Amz-Expires=180&X-Amz-Signature=SIGNATUREHERE&X-Amz-SignedHeaders=host%3Bx-amz-meta-filename&x-amz-meta-filename=24px.png"

```

Any help would be appreciated!

Thanks

---

<div class="post-metadata">

**Author:** ![weiiew](https://avatars.discourse-cdn.com/v4/letter/w/82dd89/32.png) [@weiiew](https://community.transloadit.com/u/weiiew)\
**Post date:** [September 17, 2019, 7:06pm UTC](https://community.transloadit.com/t/aws-s3-getuploadparameters-help/15061/2 "2019-09-17T19:06:07Z")

</div>

It seems to be my back-end aws-sdk function, since the URL that is generated keeps giving me the error:

The request signature we calculated does not match the signature you provided. Check your key and signing method.

---

<div class="post-metadata">

**Author:** ![goto-bus-stop](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/goto-bus-stop/32/18_2.png) [@goto-bus-stop](https://community.transloadit.com/u/goto-bus-stop)\
**Post date:** [September 18, 2019, 2:12pm UTC](https://community.transloadit.com/t/aws-s3-getuploadparameters-help/15061/3 "2019-09-18T14:12:13Z")

</div>

In your first snippet, the result of `axios.get()` was not being returned from `getUploadParameters()`, so Uppy instead saw `undefined`. Changing it to `return axios.get()...` should fix that problem.

Given your second post, I assume you did so already? 😃

If so I’m not sure what would cause that second error yet … the signing code looks right to me, unfortunately AWS doesn’t give a lot of detail in this type of error message 😕
