From 5d6ba0f59e9bc42d1c5790c0999c9a0a1db10c94 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 8 Sep 2021 20:05:53 +0600 Subject: [PATCH] MultipartRequestCallFactory improvements --- CHANGELOG.md | 3 +++ .../inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2902c4104e..b7b09333cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ * `Version`: * `MicroUtils`: `0.5.24` -> `0.5.25` * `UUID`: `0.3.0` -> `0.3.1` +* `Core`: + * `MultipartRequestCallFactory` now will use file name as multipart `filename` parameter instead of generated + filename ## 0.35.7 diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt index 2d42d15ea9..fab01c75fb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt @@ -24,7 +24,7 @@ class MultipartRequestCallFactory : AbstractRequestCallFactory() { is MultipartFile -> appendInput( key, Headers.build { - append(HttpHeaders.ContentDisposition, "filename=${value.fileId}") + append(HttpHeaders.ContentDisposition, "filename=${value.filename}") }, block = value.file::input )