Last active
May 2, 2020 18:08
-
-
Save samuelorji/4c960dcb7018b6fee0803418ea776970 to your computer and use it in GitHub Desktop.
Streaming Movies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val route = get { | |
path("download") { | |
val file = new File("movie.mp4") | |
respondWithHeaders(RawHeader("Content-Disposition", s"""attachment; filename="movie.mp4"""")) { | |
complete(HttpEntity(ContentTypes.`application/octet-stream`, FileIO.fromPath(file.toPath))) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment