【问题标题】:Flutter Multiple Images upload from gallery从画廊上传多个图像
【发布时间】:2021-12-10 19:46:24
【问题描述】:

如何使用多部分请求从图库中上传多张图片 在颤抖? 我想通过API上传多个图片文件到服务器

【问题讨论】:

标签: flutter flutter-layout flutter-dependencies flutter-web flutter-animation


【解决方案1】:

您可以使用flutter_uploader 上传多个文件:

final taskId = await uploader.enqueue(
  url: "your upload link", //required: url to upload to
  files: [FileItem(filename: filename, savedDir: savedDir, fieldname:"file")], // required: list of files that you want to upload
  method: UploadMethod.POST, // HTTP method  (POST or PUT or PATCH)
  headers: {"apikey": "api_123456", "userkey": "userkey_123456"},
  data: {"name": "john"}, // any data you want to send in upload request
  showNotification: false, // send local notification (android only) for upload status
  tag: "upload 1"); // unique tag for upload task
);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-17
    相关资源
    最近更新 更多