mbraak/django-file-form

ChunkSize not set - ERROR Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE

sebhaase opened this issue · 3 comments

On my server I'm seeing the error:
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE
Since the tus implementation appears to be using "data" not "files" it is that limit (not FILE_UPLOAD_MAX_MEMORY_SIZE) that is relevant. In any case, uploading GB-sized files should created temporary files and get not loaded into server memory.

In file_form.debug.js I found the option chunkSize with initial value of Infinity.

  1. How can I change this to a value <= settings.DATA_UPLOAD_MAX_MEMORY_SIZE ?
  2. Could this be mentions in the documentation?

Thanks, Seb.

I will have a look.

I added a pr to fix this: #348. It will be merged shortly.

This is now fixed in release 3.0.1.

  • The chunk size is by default 2.5 MB. This is the same as the default for DATA_UPLOAD_MAX_MEMORY_SIZE.
  • You can optionally set the chunkSize option. This is described in the readme.