Logoreact-native-s3-bg-uploader

API Reference

Functions and types exposed by this library

NativeS3BgUploaderAPI

Prop

Type

WebS3BgUploaderAPI

Prop

Type

UploadProgress

Prop

Type

AggregateProgress

Prop

Type

ProgressCallback

type ProgressCallback = (
  fileProgress: UploadProgress,
  sessionAggregate: AggregateProgress,
  transferAggregate: AggregateProgress,
) => void
ParameterTypeDescription
fileProgressUploadProgressProgress of the individual file that triggered the progress event
sessionAggregateAggregateProgressAggregate progress across all files in the session
transferAggregateAggregateProgressAggregate progress for all files sharing the same transferId as fileProgress

UploadState

StateDescription
NOT_STARTEDFile hash is calculated & file is enqueued for upload
INITIALIZEDstartUpload endpoint was called
RUNNINGFile is currently uploading
PAUSEDFile is currently uploading but upload of this file is paused
COMPLETEDFile has been completely uploaded & complete endpoint was called
FAILEDProcessing or upload failed for this file. Can be retried by calling resume()
CANCELLEDFile was cancelled. Will no longer be returned from any API

GlobalUploaderState

StateDescription
NOT_STARTEDInitial state of a new session. To start uploading, call resume()
RUNNINGAt least one file is currently uploading
RUNNING_IN_BGAt least one file is currently uploading. The uploader is running in background
PAUSEDAt least one file is not completely uploaded but upload is currenlty paused
COMPLETEDAll files have been completely uploaded & complete endpoint was called for every file
FAILEDProcessing or upload failed for at least one file. Can be retried by calling resume()

S3BgUploaderResumeError

Thrown byresume()

Indicates that there are stale files in the session which need to be re-provided by the user by calling uploadFile() again. Files become stale after an app restart for example.

Prop

Type

S3BgUploaderDuplicateFileError

Thrown byuploadFile()

Indicates that a file with the same hash (considering file content, file size and transferId) already exists in the session.

Prop

Type

On this page