download: formatting + error-check file creation