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

Storage.put does not save UTF-8 plain text anymore #5387

Closed
masbaehr opened this issue Apr 13, 2020 · 5 comments
Closed

Storage.put does not save UTF-8 plain text anymore #5387

masbaehr opened this issue Apr 13, 2020 · 5 comments
Labels
aws-sdk-js Storage Related to Storage components/category

Comments

@masbaehr
Copy link

masbaehr commented Apr 13, 2020

Hi, i'm experiencing the following issue - the same code was still working on Amplify v2

It also still works while replacing Привет with "Hello". I've also tried specifying the contentType to text/plain. Same error

  Storage.put("test.json", "Привет", {
      customPrefix: {
        public: "",
        protected: "",
        private: ""
      },
      bucket: "mybucket"
    })
      .then(result => {
        console.log(result);
      })
      .catch(err => {
        console.log(err);
      });

Error: 403 forbidden:
SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.

Edit i actually found a workaround but it seems kinda awkward to do:

 var fileToWrite = new Blob(["Привет"], {type: 'plain/text'});
  Storage.put("test.json", fileToWrite, {
      customPrefix: {
        public: "",
        protected: "",
        private: ""
      },
      bucket: "mybucket"
    })
      .then(result => {
        console.log(result);
      })
      .catch(err => {
        console.log(err);
      });
@masbaehr masbaehr added the to-be-reproduced Used in order for Amplify to reproduce said issue label Apr 13, 2020
@sammartinez sammartinez added Storage Related to Storage components/category version-3 labels Apr 13, 2020
@Amplifiyer
Copy link
Contributor

@masbaehr , thanks for the issue, it seems to be a bug with aws-sdk to not be able to handle UTF-8 characters correctly. aws/aws-sdk-js-v3#1100 seems to be related.

@Amplifiyer Amplifiyer added aws-sdk-js and removed to-be-reproduced Used in order for Amplify to reproduce said issue labels Apr 27, 2020
@Amplifiyer
Copy link
Contributor

@masbaehr can you test again with latest amplify and let us know if it's fixed?

@masbaehr
Copy link
Author

It seems to be working again 👍

@ashika01
Copy link
Contributor

ashika01 commented Jun 1, 2020

Closing this issue since it is not happening with the latest version which merged in aws-sdk gamma version.

@ashika01 ashika01 closed this as completed Jun 1, 2020
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-js Storage Related to Storage components/category
Projects
None yet
Development

No branches or pull requests

4 participants