Hien Nguyen
08/30/2021, 7:32 AM<http://httpClient.post|httpClient.post><Unit> {
val bucket = it.fields.bucket
url {
encodedPath = bucket
}
body = MultiPartFormDataContent(
formData {
append("bucket", bucket)
append("Policy", it.fields.policy)
append("X-Amz-Date", it.fields.date)
append("X-Amz-Algorithm", it.fields.algorithm)
append("X-Amz-Signature", it.fields.signature)
append("X-Amz-Security-Token", it.fields.securityToken)
append("X-Amz-Credential", it.fields.credential)
append("acl", it.fields.acl)
append("key", it.fields.key)
appendInput(
key = "file",
headers = Headers.build {
append(HttpHeaders.ContentDisposition, "filename=uuid.jpg")
append(HttpHeaders.ContentType, "image/jpeg")
}) {
buildPacket { writeFully(input.imageByteArray) }
}
}
)
}
but I meet the below error
javax.net.ssl.SSLException: Write error: ssl=0xcbc0b608: I/O error during system call, Broken pipe
😞 If I upload the image to another server (not S3 anymore), the upload is successfully
anyone help me 😞 ?Todd
08/30/2021, 11:35 AMAleksei Tirman [JB]
08/30/2021, 1:57 PMHien Nguyen
08/31/2021, 2:36 AMappendInput
above by append
and it worked