Develop the download function.