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

Just found out React Native supports file uploads, add to readme? #7

Closed
wootwoot1234 opened this issue Mar 21, 2016 · 1 comment
Closed

Comments

@wootwoot1234
Copy link

Might not be a bad idea to add to the readme...

https://github.com/facebook/react-native/blob/master/Libraries/Network/FormData.js#L29

Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests
with mixed data (string, native files) to be submitted via XMLHttpRequest.

Example:

  var photo = {
    uri: uriFromCameraRoll,
    type: 'image/jpeg',
    name: 'photo.jpg',
  };

  var body = new FormData();
  body.append('authToken', 'secret');
  body.append('photo', photo);
  body.append('title', 'A beautiful photo!');

  xhr.open('POST', serverURL);
  xhr.send(body);
@booxood
Copy link
Owner

booxood commented Mar 22, 2016

Ok, thanks for your example.

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

No branches or pull requests

2 participants