Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Multiple values in same field #56

Open
luaVolk opened this issue May 19, 2019 · 0 comments
Open

Multiple values in same field #56

luaVolk opened this issue May 19, 2019 · 0 comments

Comments

@luaVolk
Copy link

luaVolk commented May 19, 2019

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
});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant