2012-02-27 122 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