【发布时间】:2021-12-10 19:46:24
【问题描述】:
如何使用多部分请求从图库中上传多张图片 在颤抖? 我想通过API上传多个图片文件到服务器
【问题讨论】:
标签: flutter flutter-layout flutter-dependencies flutter-web flutter-animation
如何使用多部分请求从图库中上传多张图片 在颤抖? 我想通过API上传多个图片文件到服务器
【问题讨论】:
标签: flutter flutter-layout flutter-dependencies flutter-web flutter-animation
您可以使用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
);
【讨论】: