Vampire
01/27/2025, 2:52 AMpart.provider().readRemaining().readByteArray()
I only get an empty array, while I know for sure that there is content.Aleksei Tirman [JB]
01/27/2025, 7:54 AMVampire
01/27/2025, 7:56 AMcall.receiveText()
.Aleksei Tirman [JB]
01/27/2025, 7:59 AMVampire
01/27/2025, 11:51 AMVampire
01/27/2025, 11:52 AMval parts = call
.receiveMultipart()
.asFlow()
.toList()
.map {
when (it) {
is PartData.FileItem -> {
it.name to it.provider().readRemaining().readText()
}
else -> {
logger.error { "Unexpected part data ${it::class.simpleName}" }
call.respondText(
text = HttpStatusCode.InternalServerError.description,
status = HttpStatusCode.InternalServerError,
)
return@post
}
}
}
.associate { it }
for being able to to the return@post
.
I need to do the map
still in the flow and toList
after that, then it works and have to determine after that whether to return@post
.