Change downloaded file name using Alamofire

1

I'm developing an iOS app where I update by downloading the JSON file with the new data, this file generated by PHP

let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)

Alamofire.download(MINHA_URL.PHP, to: destination).response { response in
     print(response)
}

He is downloading the file with the PHP file name (MINHA_URL.PHP), how do I rename this file to "test.json"?

    
asked by anonymous 03.01.2017 / 01:27

0 answers