title: how to upload file into server directory with grails?
body: <p>how to upload file into server directory..
  if my project at D:\myapp and i run with cmd d:\myapp grails run-app
  when i run this app and other Computer run it and upload file..it will save ini computer server in directory D:\myapp\upload ?</p>
  
  <p>i try this ini gsp.</p>
  
  <pre><code>&lt;g:form action="list" enctype="multipart/form-data" useToken="true"&gt;
      &lt;span class="button"&gt;
          &lt;input type="file" name="filecsv"/&gt;
          &lt;input type="button" class="upload" value="Upload"
                 onclick='location.href = "${createLink(url: [action: 'upload'])}"'/&gt;
      &lt;/span&gt;
  &lt;/g:form&gt;
  
  def upload = {
  
      def f = request.getFile('filecsv')
      if (f.empty) {
          flash.message = 'file cannot be empty'
          render(view: 'list')
          return
      }
  
      f.transferTo(new File('C:\Users\meta\Documents\workspace-sts-2.5.2.RELEASE\wawet\wallet\uploads\file_name.csv'))
      response.sendError(200, 'Done')
  }
  </code></pre>
  
  <p>this is the error : </p>
  
  <pre><code>2014-02-03 10:43:02,706 [http-8080-2] ERROR errors.GrailsExceptionResolver  - No signature of method: org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper.getFile() is applicable for argument types: (java.lang.String) values: [filecsv]
  Possible solutions: getXML(), getAt(java.lang.String), getAt(java.lang.String), getLocale(), getJSON(), getHeader(java.lang.String)
  groovy.lang.MissingMethodException: No signature of method: org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper.getFile() is applicable for argument types: (java.lang.String) values: [filecsv]
  Possible solutions: getXML(), getAt(java.lang.String), getAt(java.lang.String), getLocale(), getJSON(), getHeader(java.lang.String)
          at com.teravin.wallet.LoanAccountController$_closure12.doCall(com.teravin.wallet.LoanAccountController:308)
          at com.teravin.wallet.LoanAccountController$_closure12.doCall(com.teravin.wallet.LoanAccountController)
          at java.lang.Thread.run(Thread.java:744)
  </code></pre>