Skip to content

An iOS and Android cross patform React Native module to upload files from the device local storage to a server using a multipart/form-data request.

License

Notifications You must be signed in to change notification settings

happierco/react-native-file-uploader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-file-uploader npm version

An iOS and Android cross patform React Native module to upload files from the device local storage to a server using a multipart/form-data request.

Installation

$ npm install react-native-file-uploader --save
$ rnpm link react-native-file-uploader

Usage

import FileUploader from 'react-native-file-uploader'

const settings = {
  uri,
  uploadUrl,
  method, // default to 'POST'
  fileName, // default to 'yyyyMMddhhmmss.xxx'
  fieldName, // default to 'file'
  contentType, // default to 'application/octet-stream'
  data: {
    // extra fields to send in the multipart payload
  }
};

FileUploader.upload(settings, (err, res) => {
  // handle result
}, (sent, expectedToSend) => {
  // handle progress
});
      

Supported uri types

ios

  • file:
  • absolute path

android

  • file:
  • content:
  • absolute path

About

An iOS and Android cross patform React Native module to upload files from the device local storage to a server using a multipart/form-data request.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 57.1%
  • Objective-C 38.9%
  • JavaScript 4.0%