do curl with response to file