title: Grails File Upload Problems
body: <p>I'm trying to emulate the file upload code from the grails website, and I'm running into some problems.  I'm using the same code as found <a href="http://grails.org/Controllers+-+File+Uploads" rel="nofollow noreferrer">here</a>.  Here is my code:</p>
  
  <pre><code>    &lt;g:form action="upload" method="post" enctype="multipart/form-data"&gt;
          &lt;input type="file" name="myFile" /&gt;
          &lt;input type="submit" value="Upload" /&gt;
      &lt;/g:form&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>def upload = {
      def f = request.getFile('myFile')
      if(!f.empty) {
        flash.message = 'success'
      }    
      else {
         flash.message = 'file cannot be empty'
      }
  }
  </code></pre>
  
  <p>I'm receiving the following error at runtime:</p>
  
  <pre><code>Message: No signature of method: org.mortbay.jetty.Request.getFile() is applicable for argument types: (java.lang.String) values: {"myFile"}
  Caused by: groovy.lang.MissingMethodException: No signature of method: org.mortbay.jetty.Request.getFile() is applicable for argument types: (java.lang.String) values: {"myFile"}
  </code></pre>
  
  <p>It appears to be related to some Spring configuration. Spring does not appear to be injecting <code>MultipartHttpServletRequest</code>, so my request doesn't have the appropriate method.  I just created this applications using <code>grails create-app</code>.  I have not modified the resources.groovy file.  I'm using grails 1.0.3.</p>
  
  <p>Any help is much appreciated.  The grails website makes this look so easy.</p>