Closed namig-tahmazli closed 4 years ago
Hi @namig-accenture, thanks for the report. Could you receive the response as ByteArray
and post it here?
Hi!
I have the same problem while loading pdf MultiPartFormData
Response as ByteArray is:
println("response bytes as HEX String: " + response.readBytes().toHexString()) println("response size: " + response.readBytes().size)
Output:
response bytes as HEX String:
response size: 0
Turning logging off fixes the problem but I can't use it as workaround.
Hi @e5l Sorry for the late reply, I was uploading the file as a byte array, I was not receiving it as a byte array. As far as I understood when Ktor logs request data (in this case images as a byte array) it crashes. Because if I disable logging for Ktor uploading file as a byte array works fine.
Could you reproduce it with 1.3.2
? We muted all logging exceptions.
Hi @e5l , I am sorry for the late reply. I can confirm that the issue still appears with Ktor version 1.3.2.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Hi. I am using Ktor Client with version 1.3.1 for MPP
I have been using Ktor version 1.2.6 in my MPP project with Kotlin version 1.3.61 and it was working fine, so I was able to upload files without a problem. Later I update Kotlin version to 1.3.72 which forced me to update Ktor version 1.3.1 as version 1.2.6 was compiled with Kotlin version 1.3.61 which IDE can not compile with Kotlin plugin 1.3.72. After that file upload call started to give me the following exception.
I am uploading a file like this.
Here file data is just an object which keeps File data as a byte array so by that I can convert image to byte array (either from Android / IOS) and upload it.
Thank you very much for your help in advanced.