-
Notifications
You must be signed in to change notification settings - Fork 14
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(react-native): support direct uploads through FormData #307
Conversation
This pull request introduces 1 alert when merging cee8588 into 2c5dbf8 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 43c50a4 into 2c5dbf8 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 59d1be1 into 7606df9 - view on LGTM.com new alerts:
|
src/tools/buildFormData.ts
Outdated
@@ -9,24 +9,26 @@ import { BrowserFile, NodeFile } from '../request/types' | |||
* in browsers. | |||
*/ | |||
|
|||
type FileTuple = ['file', BrowserFile | NodeFile, string] | |||
type FileTriple = ['file', BrowserFile | NodeFile, string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
FileTripple => FileTuple?
isFileTriple(tuple)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not typo, triple is 3-tuple. I thought it was better to call this type triple
, but now I think it's better to left it as it was. So I reverted it back.
This pull request introduces 1 alert when merging be65ca0 into 589ddbe - view on LGTM.com new alerts:
|
Fixes #306
Description
We upload small files through XHR and FormData. React-Native has its own implementation of XHR, FormData, Blobs, Files and everything else. And FormData for some reason doesn't support Blob arguments, instead it takes an object of type
{ name?: string; type?: string; uri: string }
(see https://github.com/facebook/react-native/blob/master/Libraries/Network/FormData.js#L37)