i've sent a file to server using retrofit it was working correctly . i refactored my project to ktor and it keeps getting the: unexpected end of stream exeception.
httpClient.submitFormWithBinaryData(
url = ApiConstants.SETTING_POS_PHOTO_UPLOAD,
formData = formData {
append("serial_number", SK210Manager.getSerialNumber())
appendInput(
"photo", headers = Headers.build {
append(HttpHeaders.ContentType, uploadPhotoRequest.contentType)
append(
HttpHeaders.ContentDisposition,
"filename=${TransactionDetails.imageFileName}"
)
},
size = uploadPhotoRequest.file.size.toLong()
) {
buildPacket {
writeFully(uploadPhotoRequest.file)
}
}
}) {
}
class UploadPhotoRequest(
val cashlessId = "1111",
val file: ByteArray,
val contentType = "image/jpg",)
i can not find where is the problem