Uploading to S3 in React Native with progress updates

07 Mar 2018

The official approach for using AWS with React Native is to use the Javascript SDK or the AWS Amplify library:


However, neither library will report the progress of a file being uploaded to S3:

for performance reasons, the SDK does not split string or Buffer uploads into chunks just to track progress in Node. The SDK tracks upload progress in browsers (using XmlHttpRequest’s progress event) and when uploading a stream in Node (by tracking how much of the input stream has been read by Node’s underlying HTTP client).


For now we can use react-native-aws3 to get upload progress even though the project is no longer maintained.

Hopefully in the future Amplify adds progress updates and React Native supports the progress events.

For reference, here is some example code that would give progress in the browser:

var params = {
  Bucket: "myBucket",
  Key: myFileName,
  Body: file,
  ContentType: 'image/png'

const request = S3.putObject(params);
request.on('httpUploadProgress', function (progress) {
  console.log(progress.loaded + " of " + progress.total + " bytes");


const req = S3.upload(params).on('httpUploadProgress', function (progress) {
}).send(function (error, data) {
  if (error)
    const url = S3.getSignedUrl('getObject', { Key: params.Key });