form field names are changed to 'f1', 'f2' after being submitted

56 Views Asked by At

I've used the template yesod-simple to create a scaffold.

The handler Home.hs has these lines:

-- Define our data that will be used for creating the form.
data FileForm = FileForm
    { fileInfo :: FileInfo
    , fileDescription :: Text
    }

When the form is submitted the development webserver shows this:

-----------------------------11220121616194905281129768369 Content-Disposition: form-data; name="f1"; filename="testfile" Content-Type: text/x-haskell

...

-----------------------------11220121616194905281129768369 Content-Disposition: form-data; name="f2"

...

Why are these post parameters changed from 'fileInfo' to 'f1', and from 'fileDescription' to 'f2'?

When using lookupPostParam now I need to use "f1" and "f2" as parameter instead of the original field names...

0

There are 0 best solutions below