I'm running into a problem with large POST data (>16384 bytes) when using Django 1.2.3, PyISAPIe v1.1.0-rc4, and IIS 7.5.
For example, when submitting approx. 60kB of form data using POST, the following happens:
- The first 16kB block of POST data are correct
- The next 16kB block is a repeat of the first block
- The next 16kB is another repeat of the first block
- The rest (<16kB) is correct again
The interesting part is that when using content-type="multipart/form-data"
, it works fine.
Using this information I tracked down the likely location of the bug to WSGIRequest._get_raw_post_data in django\core\handlers\wsgi.py, which handles the content-type="multipart/form-data"
separately from the default (no content-type) case.
Both cases read from self.environ['wsgi.input']
, which is set to the PyISAPIe object. The difference is that the default case seems to read in chunks of 16kB, whereas the multipart handler seems to read in chunks of just under 2GB.
I don't know enough about C and the Python interface for C to dig in further, but I'm guessing the bug is somewhere in PyISAPIe in the ReadClient function in ReadWrite.cpp.
My current workaround is to add content-type="multipart/form-data"
to forms that may product more than 16kB of data.
Has anybody run into this as well, or does anybody know how to determine if the bug is in fact in PyISAPIe?
Thank you!