upload method
Future<PixelBinImage?>
upload(
- File file,
- SignedDetails signedDetails, {
- int chunkSize = 1024,
- int concurrency = 1,
Implementation
Future<PixelBinImage?> upload(File file, SignedDetails signedDetails,
{int chunkSize = 1024, int concurrency = 1}) async {
if (signedDetails.url.contains("storage.googleapis.com")) {
return await uploadToGCS(
signedDetails.url,
signedDetails.fields,
file,
);
} else if (signedDetails.url.contains("api.pixelbin")) {
return await multipartFileUpload(
file, signedDetails, chunkSize, concurrency);
} else {
return await uploadToS3(
signedDetails.url,
signedDetails.fields,
file,
);
}
}