Skip to content

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

Closed
@wootwoot1234

Description

@wootwoot1234

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions