write download data to db