app / com.otago.open / PDFOperations / downloadFile

downloadFile

fun downloadFile(url: String, parentDir: String, fileName: String): String?

Downloads a file at url to the file parentDir/fileName using a HTTP GET

During the download the file is saved at parentDir/fileName.download before being moved to parentDir/fileName

Parameters

url - The file to download

parentDir - Where to save the file

fileName - The name for the downloaded file

Return
The name of the saved file (parentDir/fileName) if all succeeded, otherwise null