【问题标题】:haskell yesod file upload input file not foundhaskell yesod 文件上传输入文件未找到
【发布时间】:2015-08-10 11:46:47
【问题描述】:

处理程序:

getFuploadR=defaultLayout $ do
    [whamlet|
     <form method=post>
        <input type=file name=file>
        <button type="submit" class="btn btn-primary">Submit
    |]
postFuploadR=do
  imgnfo<-runInputPost $ ireq fileField "file"
  bytes <- runResourceT $ fileSource imgnfo $$ sinkLbs
  liftIO $ write2server bytes "1.jpg"

它编译ok.after select sth to upload and submit,我得到:

无效参数

找不到输入:文件

【问题讨论】:

  • 您需要将表单本身的enctype设置为multipart/form-data
  • 宾果游戏!我自己才发现!请正式回答这个问题,这样我就可以把它变成正确的了

标签: haskell yesod


【解决方案1】:

您需要将表单本身的 enctype 设置为 multipart/form-data

【讨论】:

    猜你喜欢
    • 2018-04-13
    • 1970-01-01
    • 1970-01-01
    • 2016-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-20
    • 1970-01-01
    相关资源
    最近更新 更多