Download fix

Need to create local directories before opening file objects in them.