I have been trying to download a file and have a function to do this dynamically that will also check if the file is already in the directory. Here is my code.