I’m trying to write a form that allows users to upload a file to my server.
I saw Yesod uses fileAFormReq for such a functionality but was unable to get it to work, running into compilation errors, the latest of which was:
“No instance for (RenderMessage MySite t)”
Any stripped down example for how to use it will be highly appreciated.
Thanks,
Uri
I’m trying to write a form that allows users to upload a file to
Share
Update 13-Sep-2012:
There is an official maintained help page for file uploading here
Googling on the function
fileAFormReqgave me this example.I Made a minimal version of it with only the relevant parts.
runhaskellthis and then visithttp://localhost:3000/filein your browser.Hope this helps. 🙂
Edit:
Oh wait, it’s obvious what you’re missing. As the compilation error just said, you’re missing a
RenderMessageinstance for your Foundation.I know recent efforts for i18n have changed the forms-package slightly. If you’re using the latest version of yesod, check this out.
The code I pasted uses the old non-i18n (default means english) version of
yesod-formspackage.