save temp files to temp directory