i try to upload a gzipped file as multipart conten...
# ktor
b
i try to upload a gzipped file as multipart content like this
Copy code
addHeader(HttpHeaders.ContentType, ContentType.MultiPart.FormData.withParameter("boundary", boundary).toString())
            setBody(boundary, listOf(
                    PartData.FileItem({ file.inputStream().asInput() }, {}, headersOf(
                            HttpHeaders.ContentDisposition,
                            ContentDisposition.File
                                    .withParameter(ContentDisposition.Parameters.Name, "file")
                                    .withParameter(ContentDisposition.Parameters.FileName, "file.txt")
                                    .toString()
                    ))
            ))
but when i get it on the server side like this
Copy code
GZIPInputStream(part.streamProvider())
it complains "Not in GZIP format" .. when i try the same code with the file directly it works. any ideas?
hmm weird .. if i read all bytes and then do GZIPInputStream(ByteArrayInputStream(bytes)) it works .. but directly using GZIPInputStream(part.streamProvider()) does not
wtf .. this also works GZIPInputStream(part.streamProvider().buffered())