http_server icon indicating copy to clipboard operation
http_server copied to clipboard

Multiple values in same field

Open luaVolk opened this issue 6 years ago • 0 comments

I'm trying to send multiple files to the server but the server only gets one.

// Client
FormData formData = FormData();

for (var i = 0; i < files.length; i++) {
  formData.appendBlob('files', files[i]);
  formData.append('paths', filePaths[i]);
}

print(formData.getAll('paths')); // Has multiple values

HttpRequest.request('/files', method: "POST", sendData: formData).then((res) {
  ...
}).catchError((e) {
  ...
});
// Server

HttpBodyHandler.processRequest(req).then((post) {
  print(post.body); // Each field only has 1 value
});

luaVolk avatar May 19 '19 15:05 luaVolk