https://kotlinlang.org logo
Title
n

Nikola Milovic

11/30/2021, 5:53 PM
How can I send files with Ktor client and FormData in KotlinJS? I receive files as
FileList
(which contains the actual Files) from React Input of type
file
. But I haven't found a way to append them to FormData. I tried using the
org.w3c.xhr.FormData
but I get the error
IllegalStateException: Fail to serialize body. Content has type: class null, but OutgoingContent expected.
But when I try to use the Ktors
io.ktor.client.request.forms
FormData, there is no override for
append
that accepts File type
n

Nikola Milovic

11/30/2021, 7:33 PM
Thank you!