getUploadDescription method

  1. @override
Future<DwUploadTicket?> getUploadDescription({
  1. String? folder,
  2. required String fileExtension,
  3. String? fileName,
})
override

Asks the server to reserve a key and sign a one-shot upload for it.

The caller does not name the key: folder says where in the bucket the object belongs, fileName suggests its readable part, and fileExtension describes the bytes actually being sent — which is not always the extension of the file that was picked. The ticket carries the signed description and the id of the reservation to confirm with.

Implementation

@override
Future<DwUploadTicket?> getUploadDescription({
  String? folder,
  required String fileExtension,
  String? fileName,
}) {
  final answer = answerUploadDescription;
  if (answer == null) {
    throw DwUnpreparedServerCall(
      'getUploadDescription',
      'answerUploadDescription',
      'folder: $folder, fileExtension: $fileExtension, fileName: $fileName',
    );
  }
  return answer(folder, fileExtension, fileName);
}