Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alamofire - Alamofire.AFError.responseSerializationFailed - Xcode 8

I get the error in Alamofire.downloand as below:

Alamofire.download(URLString).responseData { response in

            if let data = response.result.value {
                let image = UIImage(data: data)
            }else{
                print(response.result.error)
            }
        }

Alamofire.AFError.responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.inputFileReadFailed(file:///private/var/mobile/Containers/Data/Application/40167F58-FF4A-4D19-B01A-F8ED90F794DD/tmp/CFNetworkDownload_1dnNQR.tmp)))

Can anyone help solved it or facing same issues?

Thanks

like image 797
user831098 Avatar asked Sep 20 '16 03:09

user831098


1 Answers

Change the Alamofire.download to Alamofire.request, it will download. Exact answer for your question, check here

like image 131
Karthikeyan Bose Avatar answered Nov 07 '22 14:11

Karthikeyan Bose