mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-18 14:47:15 +00:00
hotfix for multipart
This commit is contained in:
parent
d97892080b
commit
1ee5b4bfd4
@ -19,6 +19,7 @@ import io.ktor.utils.io.core.Input
|
||||
import io.ktor.utils.io.core.readBytes
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.serialization.*
|
||||
import java.io.File
|
||||
import java.io.File.createTempFile
|
||||
|
||||
class UnifiedRouter(
|
||||
@ -180,7 +181,9 @@ suspend fun <T> ApplicationCall.uniloadMultipartFile(
|
||||
resultInput = MPPFile.createTempFile(
|
||||
name.nameWithoutExtension,
|
||||
".${name.extension}"
|
||||
)
|
||||
).apply {
|
||||
writeBytes(it.provider().readBytes())
|
||||
}
|
||||
}
|
||||
"data" -> data = standardKtorSerialFormat.decodeDefault(deserializer, it.provider().readBytes()).optional
|
||||
else -> onCustomFileItem(it)
|
||||
@ -212,7 +215,9 @@ suspend fun ApplicationCall.uniloadMultipartFile(
|
||||
resultInput = MPPFile.createTempFile(
|
||||
name.nameWithoutExtension,
|
||||
".${name.extension}"
|
||||
)
|
||||
).apply {
|
||||
writeBytes(it.provider().readBytes())
|
||||
}
|
||||
} else {
|
||||
onCustomFileItem(it)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user