Write the right data on upload