2012-02-27 124 views
-5

您好我有我的Grails下面的代码GSP使用Grails的输入类型=文件从文件中读取

<form action="upload-script-url" method="post" enctype="multipart/form-data"> 
    <table class="table"style="width: 75%"> 
     <tr> 
     <td> 
      <span style="font-weight: bold; ">Select the Source File:</span> 
      <input size="75" type="file" id="payload" name="payload"/> 
     </td> 
     </tr> 
     <tr> 
     <td> 
     <input type="submit" class="red" id="Run">Run</button> 
     </td> 
     </tr> 
    </table> 
    </form> 

我读了形式参数:here
是在HTML表单中的正确的参数?
现在应该如何继续读取选定文件中的数据?我必须使用apache commons fileupload api吗?
感谢

+1

[Grails的可能重复文件上传教程?](http://stackoverflow.com/questions/6030142/grails-file-upload-tutorials)+ [许多其他](http://stackoverflow.com/search?q= [grails] +上传) – 2012-02-27 11:53:46

+1

非常严重缺乏搜索技巧。这在SO和实际的Grails文档中得到了回答(如上面和下面所述)。 – 2012-02-27 11:55:32

回答

0

如果你需要一些时间来(再次)其实look at the documentation你会看到怎么办呢?

+1

-1为什么他会让你为他阅读并且突出显示相关部分,这是为什么还要记录文档? – 2012-02-27 12:40:46

+0

pri_dev的大部分问题都可以通过查看文档轻松解决。 – doelleri 2012-02-27 19:34:54