batch template file to db