Last week a customer complaint about the file uploads on his IBM Lotus Domino Servers. Users of an XPage Application frequently got an error 101 ERR_CONNECTION_RESET during a file upload. But the XPage Application was configured correctly and he developed it in a way to display an error message if a file exceeds a configured size.



What is the reason for this behavior? First let´s have a look at all file upload parameters on a Domino Server, there are at least four:

  1. Server document - Internet protocols - HTTP -> Maximum size of request content

    With this parameter you can limit the maximum size of request data which the http task accepts. If the value of this parameter will be reached by an upload or request the server will reset the connection to save the servers availability. With a value of 0 you allow unlimited requests.

  2. Web Site Configuration or Server Document -> Maximum POST data size

    With this parameter you can limit the files being accepted for upload to domino applications.

  3. Servers default File -> Property: xsp.upload.maximumsize
    With this parameter you set the default maximum upload size for all XPage applications.

  4. Applications File -> Property: xsp.upload.maximumsize
    With this parameter you can override a given server default and set a special application based file upload limit.

Second you have to know which setting precedes the other. The order is Maximum size of request content  >= Maximum POST data size >= Application 'xsp.upload.maximumsize'] >= Server 'xsp.upload.maximumsize'

Most developers are only able to set the xsp.upload.maximumsize and have to hope that their administrator have set reasonable values for Maximum size of request content and Maximum POST data size on the server. Otherwise they can develop whatever they want with the core file upload control but it won't work because the server settings precede their code. But what does a developer need to do to display a nice error page if a maximum size of a request is set?

Developers should code their own file upload control and take full control of the file upload. There are nice custom controls on OpenNTF, for example the XPages Multiple File Uploader by Mark Leusink. But most custom controls for file uploads have some prerequistes like HTML5 or Flash installed. If you don't like that, just write your own custom control and perhaps use the File Upload classes of Apache Commons. At least this gives you the chance to catch the 101 error and to display another error page.  An other way might be to use a Java Applet.