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

Getting CORS error on uploading file on AWS S3 #235

Open
abhimanusharma opened this issue Jul 2, 2021 · 3 comments
Open

Getting CORS error on uploading file on AWS S3 #235

abhimanusharma opened this issue Jul 2, 2021 · 3 comments

Comments

@abhimanusharma
Copy link

abhimanusharma commented Jul 2, 2021

Here is my jsx code:

<ReactS3Uploader
    getSignedUrl={props.getSignedUrl}
    accept="image/*"
    onProgress={onProgress}
    onError={onError}
    onFinish={onFinish}
    uploadRequestHeaders={{
        'x-amz-acl': 'public-read'
    }}
    contentDisposition="auto"
/>

Here is my method:

getSignedUrl = async (file, callback) => {
    const { dispatch } = this.props;
    const params = {
      objectName: file.name,
      contentType: file.type
    };
    const response = await dispatch(getSignedUrl(params));
    console.log(response);
    callback(response);
    
  }

The above dispatch method is getting signed url from my NestJs server.

Here is my error:
Screenshot from 2021-07-02 12-55-17

@abhimanusharma abhimanusharma changed the title Error getting url from async server request Getting CORS error on uploading file on AWS S3 Jul 2, 2021
@mclean25
Copy link

mclean25 commented Aug 6, 2021

@abhimanusharma were you able to solve this?

@waleedarshad
Copy link

@abhimanusharma @mclean25 any updates?

@rolandin
Copy link

Also getting a cors issue when uploading, it would be good to know if there is something wrong or it's just something in the server settings

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

4 participants