How to serve uploaded files in Play!2 using Scala?

The simple example is

def index = Action {
  Ok.sendFile(new java.io.File("/tmp/fileToServe.pdf"))
}

there is “Serving files” section at https://www.playframework.com/documentation/2.4.x/ScalaStream#Serving-files which explains how to serve files

Leave a Comment