Added: download file function implementation