[FIX] Write local file in tmp directory