title: Play framework with scala image upload server error
body: <p>When I upload images localhost there is no problem on uploading. 
  But when deployed on server (dokku on digitalocean) server returns error 500 with NoSuchFile exception. What is my mistake?</p>
  
  <pre><code>def upload = Action(parse.multipartFormData) { request =&gt;
        request.body.file("file").map { picture =&gt;
           import java.io.File
           val filename = picture.filename
           val extension = Files.getFileExtension(filename)
           val contentType = picture.contentType
           Logger.warn(extension)
           val newFileName = s"${UUID.randomUUID}.$extension"
           val uniqueFile = new File(s"public/pictures/$newFileName")
           picture.ref.moveTo(uniqueFile)
           Ok(newFileName)
    }.getOrElse {
           Ok("error")
    }
  }
  </code></pre>
  
  <p>error log:</p>
  
  <blockquote>
    <p>@6oo5djflc - Internal server error, for (POST) [/template/uploadLogo]</p>
    
    <p>play.api.UnexpectedException: Unexpected
    exception[NoSuchFileException:
    /tmp/playtemp71801546008559360/multipartBody6913035116351905525asTemporaryFile
    -> public/pictures/1046fe85-d910-41f4-a52f-53a6f2506d76.png]</p>
  </blockquote>