Hey guys, I'm trying to do multipart file uploadin...
# ktor
a
Hey guys, I'm trying to do multipart file uploading and it works when I run the test code I wrote, and it's not just the test passing like it actually works, but simulating the request w/ curl and postman don't With curl, I'm getting this error I don't understand how to fix
Copy code
20:30:23.445 [nettyCallPool-4-3] ERROR ktor.application - Unhandled: POST - /api/images/upload
kotlinx.coroutines.channels.ClosedReceiveChannelException: Unexpected EOF: expected 44 more bytes
Here is the route
Copy code
fun Route.upload(imageService: ImageService) {
    post("/upload") {
        val multipart = call.receiveMultipart()
        val params = call.receive<Parameters>()
        val key = params["key"]
        println(multipart)
        println(key)
        if (key != null) {
            val user = imageService.getUserWithKey(key)
            multipart.forEachPart { part ->
                if (part is PartData.FileItem) {
                    val imageResponseMap = OutFacingImage(imageService.uploadImage(part, user))
                    call.respond(imageResponseMap)
                }
            }
        }
    }
}