You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FYI - I'm using `dio` directly in Dart on Mac, not within Flutter.Flutter 3.27.1 • channel stable • https://github.com/flutter/flutter.gitFramework • revision 17025dd882 (8 weeks ago) • 2024-12-17 03:23:09 +0900Engine • revision cb4b5fff73Tools • Dart 3.6.0 • DevTools 2.40.2
Dart Version
3.6.0
Steps to Reproduce
Here's a code sample that I'm using to upload an mp4 audio file:
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.
The text was updated successfully, but these errors were encountered:
Are they gonna let me upload random files with 2 hours of audio data? In terms of the dio side, I've included exactly the relevant code.
Have you tried running a file upload with dio from a Mac CLI app? Or even a Mac Flutter app? Have you experienced the correct progress report using this API? It seems likely to me that this behavior is completely broken for everyone. If you haven't already, I would encourage you to try a file upload from a Mac and see what's reported on your end.
Are they gonna let me upload random files with 2 hours of audio data? In terms of the dio side, I've included exactly the relevant code.
Oh, that was unsure for sure. :)
Have you tried running a file upload with dio from a Mac CLI app? Or even a Mac Flutter app?
No, I'm not near my Mac.
Have you experienced the correct progress report using this API?
Yes, the callback used to work IIRC. The library uses the HttpClient as the underlying implementation, if the problem does not come from it, it should be some recent changes that break the behavior. I just glanced at our tests and unfortunately, we seem not to have proper tests about it.
If you haven't already, I would encourage you to try a file upload from a Mac and see what's reported on your end.
What I wanted to say is that the bug reporter is the one nearest to the repro environment, which would make it easy to provide a reproducible example.
Package
dio
Version
5.8.0+1
Operating-System
MacOS
Adapter
Default Dio
Output of
flutter doctor -v
Dart Version
3.6.0
Steps to Reproduce
Here's a code sample that I'm using to upload an mp4 audio file:
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.
The text was updated successfully, but these errors were encountered: