Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 signature does not match when file has custom extension #138

Open
Martinsos opened this issue Aug 22, 2017 · 2 comments
Open

403 signature does not match when file has custom extension #138

Martinsos opened this issue Aug 22, 2017 · 2 comments

Comments

@Martinsos
Copy link

I am getting an 403 SignatureDoesNotMatch error when I try to upload a file that has custom extension (not standard one).
I see in the logs that network request that is being sent to the server in order to get signed url has contentType=, meaning it is set to nothing. I am guessing file.type returns nothing so that is why this happens? Is this something you could support in the future, or should I go around it myself?

Thanks!

@palpandiR
Copy link

I have same error -- I was upload via signedurl via ajax working fine not form here.

I am getting the 403 error

@Martinsos
Copy link
Author

Martinsos commented Oct 4, 2017

I went around this by passing my own function to getSignedUrl prop:

<ReactS3Uploader
          getSignedUrl={this.getSignedUrl}
          {/* Other props here */}
        />

and my function looks smt like this:

getSignedUrl(file, callback) {
  const params = {
    contentType: file.type || 'application/octet-stream'
  };
  api.get('/s3/sign', { params })
    .then(response => {
      callback(response.data);
    })
    .catch(error => {
      console.error(error);
    });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants