-1

我正在使用 grails 3.0.0.M1 进行一些测试,并且我有一个表单可以使用以下方式将文件发送到服务器:

鉴于:

<g:uploadForm controller="file" action="upload">
    <input type="file" name="file" />
    <input type="submit" value="send"/>
</g:uploadForm>

在控制器中我有:

def file() {
    def f = request.getFile("file")
    //....some code  
}

使用 f 我有一个 NullPointerException ,也就是说服务器没有从视图中接收文件。我该如何解决?谢谢!

4

1 回答 1

0

Grails 3.0.0 M1 中存在一些关于文件上传的问题,请尝试 3.0.0 RC2

于 2015-03-18T10:25:13.643 回答