haskell-servant / servant-multipart

Support for file uploads in multipart/form-data for servant
https://hackage.haskell.org/package/servant-multipart
40 stars 37 forks source link

When file input is left blank, still a temporary file is created #49

Open rubenmoor opened 3 years ago

rubenmoor commented 3 years ago

I don't know if is intended that way. It confused me a bit. I guess I can check whether or not the user actually filled in the file input by check fdFileName.

rubenmoor commented 3 years ago

Turns out that fdFileName even has a value that is not the empty string. How to check if a file input actually contains any file?

rubenmoor commented 3 years ago

Turn out that fdFileName has the value "", i.e. a non-empty string with to quotes in it. The problem might be related to the fact that I am having two file inputs in my multipart form.

tfc commented 3 years ago

I also ran into this. checking for the value "" in fdFileName is also the method i came up with to check for this condition, but it feels unsound.