apache/cordova-ios — pull request #39 by clelland (2013-03-21 20:07:42+00:00)
Title: [CB-2537] Implement streaming downloads for FileTransfer

This patch allows large downloads to stream, by writing the accumulated data to the filesystem every time didReceiveData is called.

This also means that we can fail sooner if the destination file cannot be created / written, as we discover that in the didReceiveResponse method.

If the HTTP download request does not return a 200, then the old code is used, and the HTTP response body is read into an NSMutableData buffer so that it can be returned as the body of the FileTransferError object.