I had a problem with big POST data (> 16384 bytes) when using Django 1.2.3, PyISAPIe v1.1.0-rc4 and IIS 7.5.
For example, when sending approx. 60 KB of form data using POST, the following happens:
- The first 16 KB POST data block is correct.
- The next 16kB block is a repetition of the first block
- The next 16kB is another repeat of the first block
- The rest (<16kB) are again correct.
Interestingly, when using content-type="multipart/form-data" it works fine.
Using this information, I found the likely location of the error in WSGIRequest._get_raw_post_data in django \ core \ handlers \ wsgi.py, which handles content-type="multipart/form-data" separately from the default case (no content).
Both cases self.environ['wsgi.input'] with self.environ['wsgi.input'] , which is installed in the PyISAPIe object. The difference is that the default case seems to be read in 16 kB chunks, while the multiprocessor handler seems to read the chunks a little less than 2 GB.
I donβt know enough about C and the Python interface for C to dig further, but I assume that the error is somewhere in PyISAPIe in the ReadClient function in ReadWrite.cpp.
My current solution is to add content-type="multipart/form-data" to forms that can handle more than 16 KB of data.
Does anyone come across this, or does anyone know how to determine if the error is really in PyISAPIe?
Thanks!
source share