title: Retrieve file from POST request with NanoHttpd
body: <p>I am trying to use the NanoHttpd library to upload files to my Android server by using a POST request from a form. I do receive the POST request on the server side. My question is how to retrieve the file from the POST request so I can save it somewhere in the device memory.</p>
  
  <p>the form :</p>
  
  <pre><code>&lt;form action='?' method='post' enctype='multipart/form-data'&gt;
      &lt;input type='file' name='file' /&gt;`enter code here`
      &lt;input type='submit'name='submit' value='Upload'/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>the serve method :</p>
  
  <pre><code>@Override
  public Response serve (IHTTPSession session) {
  Method method = session.getMethod();
  String uri = session.getUri();
  
      if (Method.POST.equals(method)) {
        //get file from POST and save it in the device memory
      }
  
      ...
  
  }
  </code></pre>