King River Lee
08/07/2023, 2:25 AMKing River Lee
08/07/2023, 8:18 AM"/materialDownload" meta {
summary = "download material by id"
queries += Query.long().required("id")
returning(
Status.OK,
)
} bindContract Method.GET to { req ->
val m = ByteArray(100)
val fName = URLEncoder.encode("filename.txt", Charsets.UTF_8)
Response(Status.OK)
.header("Content-Disposition", "attachment; filename=$fName")
.body(m.inputStream())
}