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| Parameter | Type | Description |
|---|---|---|
fileProgress | UploadProgress | Progress of the individual file that triggered the progress event |
sessionAggregate | AggregateProgress | Aggregate progress across all files in the session |
transferAggregate | AggregateProgress | Aggregate progress for all files sharing the same transferId as fileProgress |
UploadState
| State | Description |
|---|---|
NOT_STARTED | File hash is calculated & file is enqueued for upload |
INITIALIZED | startUpload endpoint was called |
RUNNING | File is currently uploading |
PAUSED | File is currently uploading but upload of this file is paused |
COMPLETED | File has been completely uploaded & complete endpoint was called |
FAILED | Processing or upload failed for this file. Can be retried by calling resume() |
CANCELLED | File was cancelled. Will no longer be returned from any API |
GlobalUploaderState
| State | Description |
|---|---|
NOT_STARTED | Initial state of a new session. To start uploading, call resume() |
RUNNING | At least one file is currently uploading |
RUNNING_IN_BG | At least one file is currently uploading. The uploader is running in background |
PAUSED | At least one file is not completely uploaded but upload is currenlty paused |
COMPLETED | All files have been completely uploaded & complete endpoint was called for every file |
FAILED | Processing or upload failed for at least one file. Can be retried by calling resume() |
S3BgUploaderResumeError
Thrown by
resume()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 by
uploadFile()Indicates that a file with the same hash (considering file content, file size and transferId) already exists in the session.
Prop
Type