Catalysis of the reaction: 7,8-dihydrofolate + ATP + formate = 10-formyldihydrofolate + ADP + H(+) + phosphate.