Skip to content

FileUploadTask

Uploads a local file to CAWS in the background.

Created and started by FileStorageReference.upload. Await onComplete to get the CarpFileResponse of the stored file.

Inheritance

Properties

file

File file
getter/setter pair

The file to upload.

metadata

Map<String, String> metadata
getter/setter pair

Metadata for the file.

The filename and size entries are added when the upload starts.

name

String get name

The file name, i.e. the last segment of the file path.

onComplete

Future<CarpFileResponse> get onComplete

Completes with the CarpFileResponse when the upload succeeds.

Completes with an error for an unsuccessful HTTP response whose error body can be decoded, or if the task is canceled. Other failures are not consistently forwarded here and may leave this future pending.

Methods

cancel

void cancel()
override

Cancels the upload task and completes onComplete with an error.