You want to accept files on your server and output their text content to the user. What code should you put instead of the three dots in the handler code?
routing {
post("/page") {
...
}
}You want to accept files on your server and output their text content to the user. What code should you put instead of the three dots in the handler code?
routing {
post("/page") {
...
}
} }
val parts = call.receiveMultipart().readAllParts()
val fileText = part.streamProvider().readBytes().toString(Charsets.UTF_8)
}
call.respondText(fileText)
for (part in parts) {
if (part is PartData.FileItem) {
Create a free account to access the full topic