I am having a terrible time trying to find the cause of the error when uploading a file (the size of the file does not matter) via HTTP to a Windows 2012 R2 Essentials (IIS 8.5) webserver.
The application runs flawlessly on Windows 2003 (IIS 6). It also runs great on my Windows 7 development PC running IIS 7.5
Since IIS Manager for IIS 7.5 is so similar to IIS 8.5, I had little difficulty in configuring my ISAPI web app but everything other than file uploads works fine.
I tested basic things first:
- Just like in previous versions of IIS, I verified the upload folder permissions.
- I checked Event Viewer and don’t see anything regarding my web app.
- The request headers sent to the IIS 7.5 and IIS 8.5 versions are identical. The posted data is identical.
- Set the maximum post size.
- Added file types to the allow list.
Other things that I’ve tried:
When a large file is uploaded to the webserver, I see the w3wp.exe (32 bit process) consume CPU as the file uploads. The problem is that the error happens before any of my application code even gets a chance to work with the upload. For example:
// handle any HTTP POST
if (strcmp(spContext->GetRequestMethod(), "POST") == 0) {
// what was posted?
if (form == FILE_UPLOADED) {
// A file has been uploaded. Check it to make sure it is
// not corrupt and do what I need to do with it.
…
// I then prepare a JSON response:
m_HttpResponse.SetContentType("application/json; charset=UTF-8");
…
// Now send a reply to the client browser letting it know that the
// file was either successfully / unsuccessfully handled
…
I am guessing that it must be a IIS 8.5 configuration issue since this problem does not happen in IIS 7.5 or IIS 6.
Can someone give me their thoughts on what might be happening? Thank you!
UPDATE
Peter Hahndorf suggested that I use the Trace feature so I enabled it and this is the 'Request summary':
Url
http://www.fileuploads.tst:80/FileUpload.srf
App Pool
DefaultAppPool_classic
Authentication
anonymous
User from token
NT AUTHORITY\IUSR
Activity ID
{8000000F-0001-F800-B63F-84710C7967BB}
Site
8
Process
4652
Failure Reason
STATUS_CODE
Trigger Status
500
Final Status
500
Time Taken
0 msec
Errors & Warnings Severtity Warning
Event
MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName
IsapiModule
Notification
EXECUTE_REQUEST_HANDLER
HttpStatus
500
HttpReason
Internal Server Error
HttpSubStatus
0
ErrorCode
The operation completed successfully.
(0x0)
ConfigExceptionInfo
this field is empty...nothing to display