Download File Using Alamofire 4.0 (Swift 3)

I used to use this statements: let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) Alamofire.download( url, method: .get, parameters: parameters, encoding: JSONEncoding.default, headers: nil, to: destination).downloadProgress(closure: { (progress) in //progress closure }).response(completionHandler: { (DefaultDownloadResponse) in //here you able to access the DefaultDownloadResponse //result closure }) For more details read more in Alamofire docs about Migration to 4.0:

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)