-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
h: need triageThis issue needs to be categorizedThis issue needs to be categorizeds: bugSomething isn't workingSomething isn't working
Description
Package
dio
Version
5.8.0+1
Operating-System
MacOS
Adapter
Default Dio
Output of flutter doctor -v
FYI - I'm using dio directly in Dart on Mac, not within Flutter.
Flutter 3.27.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 17025dd882 (8 weeks ago) • 2024-12-17 03:23:09 +0900
Engine • revision cb4b5fff73
Tools • Dart 3.6.0 • DevTools 2.40.2Dart Version
3.6.0
Steps to Reproduce
Here's a code sample that I'm using to upload an mp4 audio file:
void test() {
final client = dio.Dio();
final response = await client.post(
'https://myurl',
options: dio.Options(
headers: {
"Authorization": "Bearer $authToken",
},
),
data: dio.FormData.fromMap({
'file': dio.MultipartFile.fromFileSync(
mediaFile.path,
filename: basename(mediaFile.path),
),
}),
onSendProgress: (int sent, int total) {
print('Send Progress (${(100 * sent / total).round()}): $sent/$total');
},
onReceiveProgress: (int sent, int total) {
print('Receive Progress (${(100 * sent / total).round()}): $sent/$total');
},
);
}Expected Result
The "send progress" reflects the amount of data sent to the server, at the rate it's actually being sent.
Actual Result
The "send progress" reflects the data that's loaded into memory, or otherwise processed on the client side. The progress goes way too fast. I'm stuck sitting at 100% for about a minute as my large audio file uploads to the server.
brun0xon
Metadata
Metadata
Assignees
Labels
h: need triageThis issue needs to be categorizedThis issue needs to be categorizeds: bugSomething isn't workingSomething isn't working