Unable to upload files with Flutter Dio multipartFile

257

After getting the solution to this, I felt I should delete this answer as the solution seems kinda obvious. But on a second thought, I'll leave it in because this answer might save someone hours of debug. I found out that the images files were large and the uploading process didn't complete before Dio.sendTimeout returns. So I increase the sendTimeout and reduced the size of the image file (picked using Image_picker) PickedFile.imageQuality.

Share:
257
Ercross
Author by

Ercross

Updated on December 01, 2022

Comments

  • Ercross
    Ercross over 1 year

    I set up Dio as a http client to upload image files to my server. I'm using image_picker. Initially, when I set it up like a month ago, it worked fine. But I later found out it stopped working. It still works on Android emulator but not on a physical device.

    • Yunnosch
      Yunnosch over 2 years
      Removing the info on your own trace analysis probably was not helpful for your questions chances for answers. Please reconsider that edit. Compare How to Ask.