Setting the Maximum File Upload Size for an XPages Application

If you want to control the maximum value for an uploaded file, you can use the xsp.upload.maximumsize setting in xsp.properties.

Application-Level Maximum Upload Size

There is no maximum upload set at the application level by default. (Although there is a server-level setting that I’ll come back to later in this post.)

To set it, you can use the Xsp Properties design element and set the Maximum size property under File Upload Options in the first column of the General tab. Specify the value in kilobytes (KB)

MaxFileUploadTesting-0-Setting

This adds the following value to the xsp.properties file (as seen on the Source tab):

xsp.upload.maximumsize=400

Error Message

If you add an Error Message control for the File Upload control or an Error Messages control on the form, you will see an error message regarding the file size setting when you try to submit a form with an attachment that’s too large.

MaxFileUploadTesting-1-Error

Server-wide Limit

As mentioned earlier, there’s no default at the application level. The default is the server-wide setting, which defaults to roughly 10 MB.

Even if you set the maximum at the application level, it can never exceed the server setting.

The server setting is defined on the Server document in the Domino Directory. It can be found on the Internet Protocols tab, HTTP subtab in the HTTP Protocol Limits section.

MaxFileUploadTesting-3-ServerSetting

If you try to upload a file larger than the server-wide limit, it aborts the connection and throws an ugly error. (HTTP 500 – Internal Server Error)

MaxFileUpload-ServerError

Even if you set an application level maximum lower than the server maximum, if you try to upload a file larger than the server maximum, it will throw the same HTTP error.

Advertisements

4 responses to “Setting the Maximum File Upload Size for an XPages Application”

  1. althom77 says :

    Hi – I have a query regarding the error message showing in your example (using the Error Message control) where the attachment is too large. I am unable to get this to work. I have set ‘disableClientSideValidation’ to true, however still not workoing?

    • Brad Balassaitis says :

      If it’s an individual Error Message control, make sure the “for” property is set to point to the attachment upload field. (It only displays the error from a single field and needs to know which one to check.)

      If it’s an Error Messages control, it should show any error messages on the page for all fields.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: