jeanphix/django-resumable — pull request #3 by EnTeQuAk (2012-10-25 13:13:28+00:00)
Title: More efficient chunk merging

NOTE: This requires https://github.com/23/resumable.js/pull/35 as I introduced a size checking for each chunk to harden the server against network failures or browser reloads.

NOTE 2: I am working on adapting the unittests properly so this PR is basically to get early feedback from you so that I can probably adapt to other use cases as well.

Implementation:

We must not read the file contents into memory, especially if we deal
with large amount of data which is the main use case of chunked uploads.

This commit fixes the old behavior and introduces a more efficient merging.
We still read every chunk into memory but this happens in a generator
and we do not merge in-memory so that the memory usage stays constant.