Large file uploads in Apache

It has been a problem handling uploads in Apache and CGI based system for sometime.

The fundamental problem is that POST operations are not processed by Apache's scripting system (be it CGI or built-in scripts)
until after the entire transaction is received. So Apache has to store the data somewhere until it can start the script.
As there is a finite amount of space for storing things, and Apache does not know if the upload will even be accepted,
there is a risk that a nefarious client system will upload too much.

Apache therefore has limits on how much can be uploaded.

The solution is to stop reading from the socket, leave the data on the client, and run the script.
When the script has determined that the upload should continue, it can stream the data straight to the target location.