Aman
07/25/2024, 12:26 PMonUpload { }
throwing an exception ProtocolException("unexpected end of stream")
.
I've searched for a solution but haven't found any, even though this issue was reported long time back.
@Aleksei Tirman [JB] Did you have any idea about this?
val client = HttpClient(OkHttp)
val response: HttpResponse = <http://client.post|client.post>("presigned_url") {
setBody(MultiPartFormDataContent(
formData {
append("description", "PDF")
append("image", File("dummy.pdf").readBytes(), Headers.build {
append(HttpHeaders.ContentType, "application/pdf")
append(HttpHeaders.ContentDisposition, "filename=\"dummy.pdf\"")
})
},
boundary = "WebAppBoundary"
)
)
onUpload { bytesSentTotal, contentLength ->
println("Sent $bytesSentTotal bytes from $contentLength")
}
}
Aleksei Tirman [JB]
07/25/2024, 12:41 PMAman
07/25/2024, 12:53 PMonUpload { bytesSentTotal, contentLength -> }
Aleksei Tirman [JB]
07/25/2024, 12:57 PMAleksei Tirman [JB]
07/25/2024, 12:58 PMDennis
07/29/2024, 7:32 AM