https://kotlinlang.org logo
#ktor
Title
# ktor
s

Sam

10/24/2023, 11:57 AM
Thought I'd ask here before sinking time into this, does anyone have a multiplatform (android and iOS) implementation of this? i.e file upload in a way that doesn't load the entire file into memory
Copy code
formData {
    // ...
    val file = File("ktor_logo.png")
    append(
        "image",
        InputProvider(file.length()) { file.inputStream().asInput() },
        Headers.build {
            append(HttpHeaders.ContentType, "image/png")
            append(HttpHeaders.ContentDisposition, "filename=\"ktor_logo.png\"")
        }
    )
},
https://stackoverflow.com/questions/73703274/ktor-oome-while-sending-large-file
7 Views