flutter dio how to upload multiple files ,only keep one when upload multiple files?

发布者: 粮油菜大市场 发布时间: 2022.06.15 03:27:02

flutter dio how to upload multiple files ,only keep one when upload multiple files?

we can get the answer from 

https://stackoverflow.com/questions/63263840/how-to-upload-multiple-images-files-in-flutter-using-dio

it seems work ok before ,but when i upload multiple files ,it can only keep the last one,

finally i get the answer, rename the MapEntry name to array,it is ok now

var formData = FormData();
for (var file in filepath) {
  formData.files.addAll([
  MapEntry("assignment[]", await MultipartFile.fromFile(file)),
]);
}
评论
登陆评论

没有评论