我正在使用 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 ,也就是说服务器没有从视图中接收文件。我该如何解决?谢谢!