-
-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Sometimes i get these errors while uploading data to firebase storage. However when i put UploadTask in try catch block, catch part doesnt work and also when i listen uploadtask onError part doesnt work too. For example it doesnt print "upload get err1 or err2".
try {
uploadTask = ref.putData(File(file.filePath).readAsBytesSync());
await uploadTask.snapshotEvents.listen((snapshot) {
uploadingValue =
((snapshot.bytesTransferred / snapshot.totalBytes) * 100).toInt() /
100;
print('Progress: %${uploadingValue * 100}');
}, onDone: () async {
print("UPLOAD DONE!!!");
print("uploadFail:$cloudFail");
if (!cloudFail) {
setState(() {
uploaded = true;
});
await triggerStorageFiles();
saveDb();
}
}, onError: (e) {
print("upload get err1:$e");
cancellUpload();
cloudFail = true;
saveDb();
});
} catch (e) {
print("upload get err2:$e");
}
By the way its happening while connected wifi. I dont get this err when i connected with cable.
Edit:
same error
Unhandled Exception: SocketException: OS Error: Operation timed out, errno = 60, address = firebasestorage.googleapis.com, port = 51294
its happening while uploading big file or 20-30 small files. So i think its becoming timed out with wifi connection. How can i fix it :(
Metadata
Metadata
Assignees
Labels
No labels