title: Play framework 2.2.x: Image upload in Java
body: <p>I am new to Play Framework. I am using Play framework v2.2.6 for my REST-full backend application. I want to provide a REST api for file upload, especially image file. I am developing my application in Java.</p>
  
  <p>I searched a lot but I didn't get any sample example in Java. Anyone have done anything similar?</p>
  
  <p>This is what I would like to do:</p>
  
  <ol>
  <li>Provide a route to upload image file.</li>
  <li>In the controller, I would like to check if its an image file or not. If not then return bad request.</li>
  <li>If its an image file, then save it in the file system on the server and save the location to that file.</li>
  <li>Provide a route to retrieve the saved file.</li>
  </ol>