Save data into a file