chunkedRelayUploadFile method
Future<bool>
chunkedRelayUploadFile(
- Uri url,
- String totalChunks,
- String currentChunk,
- String serverType,
- String uploadPath,
- String uploadName,
- String mimeType,
override
Implementation
@override
Future<bool> chunkedRelayUploadFile(
Uri url,
String totalChunks,
String currentChunk,
String serverType,
String uploadPath,
String uploadName,
String mimeType,
) async {
try {
final request = http.Request('POST', url);
request.bodyFields = {
'totalChunks': totalChunks,
'currentChunk': currentChunk,
'serverType': serverType,
'uploadPath': uploadPath,
'uploadName': uploadName,
'mimeType': mimeType,
};
final resp = await request.send();
await resp.stream.bytesToString();
if (resp.statusCode != 200) {
return false;
}
return true;
} catch (err) {
logger.severe('Error at StorageUtilImpl.chunkedRelayUploadFile >>> $err');
return false;
}
}