benjreinhart / react-native-aws3

Pure JavaScript React Native library for uploading to AWS S3
MIT License
399 stars 151 forks source link

Cannot upload video from CameraRoll due to bug in React-Native IOS #42

Open rickevry opened 7 years ago

rickevry commented 7 years ago

If you upload a video from an image-URL that you get from the CameraRoll, React will mix up the streams and the S3 file will be the first frame of the video (as an image), instead of the complete video.

I have run stat (react-native-fetch-blob) and can see that URL is correct and the file size is correct. (that is why I think React messes up the streams when you do the request to S3).

I will try to run another implementation of fetch to see if that works.

rickevry commented 7 years ago

I have confirmed that something is wrong with XMLHttpRequest when you post video-files. My pull request shows that it works with an implementation of fetch.

benjreinhart commented 7 years ago

Hey @rickevry,

Thanks for looking into that, others have had that issue before. Definitely interested in fixing it, but one of the goals of this project was to have no native dependencies. react-native-fetch-blob does have native dependencies, so I would prefer to avoid using it. I have to imagine there is a way to get this working with regular fetch and/or XMLHttpRequest, and if not, I would think that the react native team should ideally provide support for file/blob uploads.

Thanks for digging into this!

KlavierCat commented 7 years ago

I run into this exact issue, @rickevry's PR #43 works for me, both on iOS and Android.