-5

Hi I have the following code in my grails gsp

<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>

I read the form parameters from: here
Are those right parameters in the html form?
Now how should I proceed to read the data from the selected file? do I have to use the apache commons fileupload api ?
Thanks

Community
  • 1
  • 1
pri_dev
  • 10,215
  • 15
  • 65
  • 118
  • 1
    possible duplicate of [Grails file upload tutorials?](http://stackoverflow.com/questions/6030142/grails-file-upload-tutorials) + [many others](http://stackoverflow.com/search?q=[grails]+upload) – tim_yates Feb 27 '12 at 11:53
  • 1
    Very severe lack of search skills. This is answered on SO and in the actual Grails documentation (as stated above and below). – Jan Wikholm Feb 27 '12 at 11:55

2 Answers2

2
request.getFile("payload")

and you will get a CommonsMultipartFile

jjchiw
  • 4,018
  • 27
  • 30
0

If you take some time to (again) actually look at the documentation you will see how to do it...

tim_yates
  • 154,107
  • 23
  • 313
  • 320
  • 1
    -1 why bother with documentation when he can get you to read it for him and highlight the relevant sections? – Dónal Feb 27 '12 at 12:40
  • most of pri_dev's questions are able to be easily answered by looking at the docs. – doelleri Feb 27 '12 at 19:34