I'm tyring to upload an image that is selected by the user either through the gallery or by taking a photo but I am getting SSL_ERROR_SYSCALL(5).
Full error: boringssl_session_errorlog(236) [C1.1:2][0x105a04e20] [boringssl_session_write] SSL_ERROR_SYSCALL(5): operation failed externally to the library
I have tried a number of different methods with parameters and no parameters. I know the upload script is working as I can send a request to the endpoint using Postman and the file uploads correctly.
let headers: HTTPHeaders = [
"Content-type": "multipart/form-data"
]
let imageData = UIImagePNGRepresentation(imgPostHero.image!)
Alamofire.upload(multipartFormData:{ multipartFormData in
multipartFormData.append(imageData!, withName: "image", fileName: "uploaded_image.png", mimeType: "image/png")},
usingThreshold: UInt64.init(),
to: "https://url_to_upload_script",
method: .post,
headers: headers,
encodingCompletion: { encodingResult in
switch encodingResult {
case .success(let upload, _, _):
upload.responseJSON { response in
print(response)
}
case .failure(let encodingError):
print(encodingError)
}
})