Changeset 65


Ignore:
Timestamp:
Dec 15, 2009, 7:16:33 PM (9 years ago)
Author:
keesvb
Message:

changed the ISATAB upload function so that file upload works (deleted hardcoded reference to file)

Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/LoadController.groovy

    r64 r65  
    2222        render("Loading ...\n");
    2323
    24         File file = new File("/home/ademcan/Desktop/magetab/examples/E-GEOD-2354.idf.txt");
     24        InputStream inputStream = request.getFile("uploadfile").inputStream;
     25        BufferedReader fileReader = new BufferedReader(new InputStreamReader(inputStream));
    2526
    2627        def investigationDesign = new magetab.idf.InvestigationDesign();
     
    3536        ArrayList rows = new ArrayList();
    3637
    37         for (i in file.readLines()){
     38        for (i in fileReader.readLines()){
    3839            String line = i.toString() ;
    3940            ArrayList tmp_list = new ArrayList();
    40             List parsedTab = line.split("\t");
     41            def parsedTab = line.split("\t");
    4142
    4243            for (j in parsedTab) {
  • trunk/grails-app/views/load/index.gsp

    r63 r65  
    1818      </ul>
    1919      <div id="tab-simple">
    20         <g:form url="[action:'load',controller:'load']">
     20        <g:form action="load" controller="load" method="post" enctype="multipart/form-data">
    2121          <input type="hidden" name="targetUri" value="${targetUri}" />
    22           <label class="grey" for="querytext">Select the IDF file to load into dbNP :</label>
     22          <label class="grey" for="uploadfile">Select the IDF file to load into dbNP :</label>
    2323          <!--input class="field" type="text" name="querytext" id="querytext" size="40" /-->
    2424          <input type="file" name="uploadfile" />
Note: See TracChangeset for help on using the changeset viewer.