Copy file, instead of reading all at once, to avoid out of memory error.