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

Fix: S3 pre signed uploads or similar binary stream uploads writing corrupt files #702

Merged
merged 2 commits into from
Jul 16, 2019

Conversation

saurabytes
Copy link
Contributor

Background

RNFS is a great library to download and upload files. While trying to upload a file to S3 using a PreSigned PUT url, it was writing corrupt files as it was adding form boundary, meta data, etc to the file.

Fix

binaryStreamOnly: A newly added field in UploadFileOptions which is defaulted to false.
If this options is set true the uploader for RNFS will only write file binary data to the directed upload url. It omits all the meta data and form boundaries as they will write to the uploading stream essentially writing a corrupt file for the format provided.

@saurabytes saurabytes marked this pull request as ready for review June 27, 2019 14:29
@itinance
Copy link
Owner

This is a really good thing! Glad you find it out and fixed it!

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

Successfully merging this pull request may close these issues.

2 participants