How to get progress event while uploading file on http.MultipartRequest request in flutter


I am uploading a file using MultipartRequest from package:http. I am successfully uploading the file but I want to get the progress of the file that is being uploaded. How can I achieve that? My current code looks something like this

Future submitFile(var report, File file) async {
var uri = Uri.parse(endpoint + "v1/reports");
  var request = http.MultipartRequest("POST", uri);
  await addHeaders(request.headers);
  if (file != null)
    request.files.add(await http.MultipartFile.fromPath(

  String response = "";
  await (await request.send()).stream.forEach((message) {
    response = response + String.fromCharCodes(message);
  return response;

I searched for the solution, found this. And this post is somehow not similar to what I want to achieve, as he is using different client for the request.

Maybe I am not searching on the right path.
Help is appreciated.


After waiting for a week or so. I didn’t get response. Thus I developed a plugin myself to get this behavior. Package link.

Example to use it:

var request = MultipartRequest();

request.addFile("image", imagePath);

Response response = request.send();

response.onError = () {

response.onComplete = (response) {

//Not 100% success
response.progress.listen((int progress) {
  print("progress from response object " + progress.toString());

Update Jun 30, 2020

The package now supports iOS as well.

Answered By – Aawaz Gyawali

Answer Checked By – Gilberto Lyons (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *