Write preview data into local file