IIS Error : There has been an IO Error:Error #2038


Problem Statement :

I've set the maxRequestLength property of an IIS7 website I have running in Integrated Pipeline mode to 116384. According to the docs, that should be 116MB.  I've also set the executionTimeout property to 3600 (1 hour). However, I found myself unable to upload larger files.  I then did a test of a whole series of files to see how large I could go. Anything up to 29,280KB successfully uploaded. Anything from 29,318KB and above failed. I added a BeginRequest event on my upload module and set a breakpoint on the first line of code.  The successful uploads hit the breakpoint.  The failed uploads don't.  This means to me that there is some process that comes before the BeginRequest event that is refusing to accept these posts. I also read the configuration settings using reflection, application.Context.GetConfig("system.web/httpRuntime"), etc and it returned the amount I had set, 116384. Is there another setting I need to make?  Does anyone know why these larger posts are not being handled by my module?

Solution :


Edit upload_max in the php.ini to bigger size. Well, this was interesting. The error code was 404.13.  After some searching on that, I eventually tracked down that IIS7 requires two different settings and apparently, the default is 30000000 bytes, which is the exact limit I ran into (29,296kb). As a note, in case anyone else runs into this problem, there is one other step (which I had already done).  Since requests are streamed into memory before being processed, sometimes the application pool will recycle if it is using too much memory.  I implemented a solution shared by many file uploading components, that intercepts the HttpWorkerRequest and streams the data directly to disk, parsing out the MIME Boundries and such. Anyway, adding the second attribute to the web.config solved the problem for me.