mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-26 03:58:45 +00:00
Fixes in uniloadMultipart
This commit is contained in:
parent
d0446850ae
commit
e639ae172b
@ -2,6 +2,10 @@
|
||||
|
||||
## 0.8.9
|
||||
|
||||
* `Ktor`:
|
||||
* `Server`:
|
||||
* Fixes in `uniloadMultipart`
|
||||
|
||||
## 0.8.8
|
||||
|
||||
* `Versions`:
|
||||
|
@ -180,7 +180,13 @@ suspend fun <T> ApplicationCall.uniloadMultipartFile(
|
||||
"bytes" -> {
|
||||
val name = FileName(it.originalFileName ?: error("File name is unknown for default part"))
|
||||
resultInput = MPPFile.createTempFile(
|
||||
name.nameWithoutExtension,
|
||||
name.nameWithoutExtension.let {
|
||||
var resultName = it
|
||||
while (resultName.length < 3) {
|
||||
resultName += "_"
|
||||
}
|
||||
resultName
|
||||
},
|
||||
".${name.extension}"
|
||||
).apply {
|
||||
outputStream().use { fileStream ->
|
||||
@ -216,7 +222,13 @@ suspend fun ApplicationCall.uniloadMultipartFile(
|
||||
if (it.name == "bytes") {
|
||||
val name = FileName(it.originalFileName ?: error("File name is unknown for default part"))
|
||||
resultInput = MPPFile.createTempFile(
|
||||
name.nameWithoutExtension,
|
||||
name.nameWithoutExtension.let {
|
||||
var resultName = it
|
||||
while (resultName.length < 3) {
|
||||
resultName += "_"
|
||||
}
|
||||
resultName
|
||||
},
|
||||
".${name.extension}"
|
||||
).apply {
|
||||
outputStream().use { fileStream ->
|
||||
|
Loading…
Reference in New Issue
Block a user