download the file into the correct dir structure