aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.41k stars 2.11k forks source link

Upload image from react native succeed, but the uploaded image is bad #2211

Closed YikSanChan closed 5 years ago

YikSanChan commented 5 years ago

Describe the bug From my expo app, I follow @dabit3's instruction in which a section teaches how to pick an image with expo ImagePicker and upload the image blob to AWS Amplify Storage. Even though I am able to upload the image blob (I can tell from the image's timestamp), the image on S3 is not the one I uploaded.

To Reproduce Steps to reproduce the behavior:

  1. Create an expo+awsamplify app following the instruction.
  2. Run on IOS simulator (expo start --ios)
  3. Pick an image and upload.
  4. Go to S3 storage of the app and view the image
  5. See such an image. (I intentionally make the image public)

Expected behavior The image on S3 should be the image I upload from my IOS simulator / my IOS phone.

Smartphone (please complete the following information):

YikSanChan commented 5 years ago

This is not an amplify-js issue actually. It turns out that react-native fetch doesn't assign "blob" mime-type to the xhr properly. Please find details at https://github.com/expo/firebase-storage-upload-example/issues/13.

github-actions[bot] commented 3 years ago

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.