Make sure directory for local file exists before trying to put a file there