agrafix / Spock

Another Haskell web framework for rapid development
https://www.spock.li
679 stars 56 forks source link

Multiple file upload, but only one file in request body #143

Open aherrmann opened 6 years ago

aherrmann commented 6 years ago

Multiple file upload seems to not be handled correctly. If a user selects multiple files to upload on a file input field, such as the following, then the request body will contain only one file associated with the input field.

<input multiple name="files" id="files" type="file">

From a quick look at the code, maybe this part should use HM.fromListWith (<>) and a HashMap Text [UploadedFile]?

agrafix commented 6 years ago

Sounds like a bug! The fix seems reasonable to me, although I would prefer to use Vector instead of list. Could you write a test (and possibly a fix) for this? :)

flyingllama87 commented 4 years ago

Running into this too.