I am recieving this error message when attempting to upload a video file to the speicified URL:
DioError (DioError [DioErrorType.DEFAULT]: SocketException: OS Error: Connection reset by peer, errno = 54, address = storage.googleapis.com, port = 64995)
Note: It is a DioError
as I am using the dio
Dart/Flutter package: https://pub.dev/packages/dio I recieve the error using equivilent API such as the http
library.
Code to upload the video file selected from storage:
//File videoFile...
FormData data = FormData.fromMap({
"videoFile": await MultipartFile.fromFile(videoFile.path),
});
Response response = await Dio().post(
directUpload.url,
data: data,
onSendProgress: (int sent, int total) {
print("$sent $total");
},
);
The URL (directUpload.url
) is one generated from and provided by the Mux API to their Google Cloud Storage.
https://storage.googleapis.com/video-storage-us-east1-uploads/...
When post
is called, a small amount is uploaded (e.g. 655524 / 17840042) and then the error occurs. The test video is 17.8 Mb in size.
Running this on an iOS device or the iOS simulator produces the same result/error.
I have tried: flutter clean
, flutter upgrade
, deleteing Podfile
and pod repo update
, deleting the app from device. All to no avail.