我有这个GSP:
<g:uploadForm name="myForm" action='save'>
<input type='file' name='documentFile' value=''/>
<input type='file' name='documentFile' value=''/>
<input type='file' name='documentFile' value=''/>
<input type='file' name='documentFile' value=''/>
<input type='submit' value='Submit'/>
</g:uploadForm>
Run Code Online (Sandbox Code Playgroud)
但是当我尝试通过键入以下内容来查看控制器中的结果时:
render(params);
return true;
Run Code Online (Sandbox Code Playgroud)
我得到了这个结果:
"documentFile":org.springframework.web.multipart.commons.CommonsMultipartFile@14dcf95
Run Code Online (Sandbox Code Playgroud)
如何阅读正在上传的每个文件?我可以得到以下内容吗?
documentFile:[File,null,File,null] // (if the 2nd and the 4th are not being used)
Run Code Online (Sandbox Code Playgroud)
ps:我正在使用grails 1.2.2