IIS 7 File upload connection error

1
I'm having problems with uploading files larger than around 4MB on an on-premise installation of our application. The problem I experience is that when a user decides to upload a PDF of 6 MB in filesize, immediately an error popup is shown, stating Er is een verbindingsfout opgetreden, probeert u het later nog eens. From the Modeler side, I have the upload size limit set to 1GB and PDF is allowed as file extension. Looking at the service console, the following error is reported: java.lang.RuntimeException: org.eclipse.jetty.io.EofException: early EOF at com.mendix.m2ee.appcontainer.server.request.HttpMxRuntimeRequest.parseFileItems(HttpMxRuntimeRequest.java:167) at com.mendix.m2ee.appcontainer.server.request.HttpMxRuntimeRequest.getFileItem(HttpMxRuntimeRequest.java:136) at com.mendix.m2ee.appcontainer.server.request.HttpMxRuntimeRequest.getFileItemName(HttpMxRuntimeRequest.java:117) at com.mendix.pk.a(SourceFile:125) at com.mendix.pk.a(SourceFile:88) at com.mendix.pk.a(SourceFile:61) at com.mendix.pk.processRequest(SourceFile:54) at com.mendix.externalinterface.connector.MxRuntimeConnector.processRequest(SourceFile:74) at com.mendix.core.impl.MxRuntimeImpl.processRequest(SourceFile:729) at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.handle(RuntimeHandler.java:45) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:368) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.messageComplete(AbstractHttpConnection.java:963) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.messageComplete(AbstractHttpConnection.java:1026) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:324) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:745) Caused by: org.eclipse.jetty.io.EofException: early EOF at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:65) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887) at java.io.InputStream.read(InputStream.java:101) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64) at org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStream.java:593) at org.apache.commons.fileupload.MultipartStream.discardBodyData(MultipartStream.java:619) at org.apache.commons.fileupload.MultipartStream.skipPreamble(MultipartStream.java:638) at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:961) at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:942) at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331) at org.apache.commons.fileupload.servlet.ServletFileUpload.getItemIterator(ServletFileUpload.java:148) at com.mendix.m2ee.appcontainer.server.request.HttpMxRuntimeRequest.parseFileItems(HttpMxRuntimeRequest.java:151) at com.mendix.m2ee.appcontainer.server.request.HttpMxRuntimeRequest.getFileItem(HttpMxRuntimeRequest.java:136) at com.mendix.m2ee.appcontainer.server.request.HttpMxRuntimeRequest.getFileItemName(HttpMxRuntimeRequest.java:117) at com.mendix.pk.a(SourceFile:125) at com.mendix.pk.a(SourceFile:88) at com.mendix.pk.a(SourceFile:61) at com.mendix.pk.processRequest(SourceFile:54) at com.mendix.externalinterface.connector.MxRuntimeConnector.processRequest(SourceFile:74) at com.mendix.core.impl.MxRuntimeImpl.processRequest(SourceFile:729) at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.handle(RuntimeHandler.java:45) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:368) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.messageComplete(AbstractHttpConnection.java:963) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.messageComplete(AbstractHttpConnection.java:1026) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:324) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:745) The interesting thing is that this only happens when accessing the application through its URL (i.e. IIS). Whenever I RDP to the server and browse to localhost:<port> and upload the file, everything works fine and no error message gets thrown. Because of this, I've also researched and gone through almost all settings possible and mentioned in resources online (e.g. http://ajaxuploader.com/large-file-upload-iis-asp-net.htm regarding file size settings in IIS, but have yet to find a solution. Also, I've temporarily disabled Windows Firewall with no result. There are no proxies in use, nor are there any other firewalls in place according to the system administrator. Does anybody have any clue what I'm missing here? P.s. the problems don't occur when uploading smaller files (e.g. 1 or 2 MB) //SOLUTION thanks to Stephan Numan: In addition to maxAllowedContentLength, the web.config file also needs a line where the value of maxRequestLength (in KB) is increased, as this has a default value of 4 MB. In my case the following was added to the web.config file (for 100 MB): <system.web> <httpRuntime maxRequestLength="102400" /> </system.web> See also this link: http://forums.iis.net/t/1169846.aspx
asked
1 answers
4

compliments for the extensive research!

If no firewall is present the only thing between the browser and the mendix application is IIS. When entering without IIS (RDP with localhost) the problem doesn't occur.

Did you alter the maxRequestLength and maxAllowedContentLength values and restart the site? NOTE : MaxRequestLength is number of kilobytes, maxAllowedContentLength is number of bytes

answered