How would i check to see if a file exits on a website before attempting to download it?

Also in my code ive enclosed the instructions in Do loop and if the file doesnt exist i want to skip the code and loop to the next file.