mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-17 22:03:50 +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 io.ktor.utils.io.core.readBytes
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
import java.io.File
|
||||||
import java.io.File.createTempFile
|
import java.io.File.createTempFile
|
||||||
|
|
||||||
class UnifiedRouter(
|
class UnifiedRouter(
|
||||||
@ -180,7 +181,9 @@ suspend fun <T> ApplicationCall.uniloadMultipartFile(
|
|||||||
resultInput = MPPFile.createTempFile(
|
resultInput = MPPFile.createTempFile(
|
||||||
name.nameWithoutExtension,
|
name.nameWithoutExtension,
|
||||||
".${name.extension}"
|
".${name.extension}"
|
||||||
)
|
).apply {
|
||||||
|
writeBytes(it.provider().readBytes())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"data" -> data = standardKtorSerialFormat.decodeDefault(deserializer, it.provider().readBytes()).optional
|
"data" -> data = standardKtorSerialFormat.decodeDefault(deserializer, it.provider().readBytes()).optional
|
||||||
else -> onCustomFileItem(it)
|
else -> onCustomFileItem(it)
|
||||||
@ -212,7 +215,9 @@ suspend fun ApplicationCall.uniloadMultipartFile(
|
|||||||
resultInput = MPPFile.createTempFile(
|
resultInput = MPPFile.createTempFile(
|
||||||
name.nameWithoutExtension,
|
name.nameWithoutExtension,
|
||||||
".${name.extension}"
|
".${name.extension}"
|
||||||
)
|
).apply {
|
||||||
|
writeBytes(it.provider().readBytes())
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
onCustomFileItem(it)
|
onCustomFileItem(it)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user