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