FIX: Fix memory error when downloading large files.

- FIX: Fix memory error when downloading large files by successively writing to a temporary file rather than building a string in memory and saving that string.