Closed CPiersigilli closed 4 years ago
You can check response.statusCode to determine whether download is success.
client.downloadFile(path: file.path + "aaaa", to: destination).downloadProgress { progress in
print(progress)
}.response { response in
guard let code = response.response?.statusCode else {
return
}
if code == 200, response.error == nil, let path = response.destinationURL?.path {
print("File Downloaded to :\(path)")
} else {
print("Handle Error")
}
}
If I pass an error or it does not exist
path
inclient.downloadFile(path: String
, I have no error: Why?