Web Trenches

File upload restrictions in Lucee



I noticed that there is a file upload size restriction in Lucee (at least on Windows).  Lucee appears to use the .NET framework when uploading files.  With Adobe ColdFusion, you could adjust the IIS settings to allow for larger files to be uploaded.  With Lucee, there are TWO places you’ll need to adjust the setting.  In addition to the IIS restriction, there is also a .NET framework restriction.  You can change this one of two ways.

1. Modify the web.config for the individual site you are working on.   Add the following…

<system.web>
      <httpRuntime maxRequestLength="20480" />
</system.web>

If system.web already exists, then just add the httpRuntime line.

UPDATE: Newer versions of IIS (IIS 10 in my case) also have an execution timeout that can prevent the file from finishing uploading. So, you may need to add that too. Change the 999999 to your preference.

<system.web>
      <httpRuntime maxRequestLength="20480" executionTimeout="999999" />
</system.web>

OR

2. Modify the web.config for the .NET framework you are using.  This will apply the change to all sites/contexts on the server.  This file is at the following location:

%windir%\Microsoft.NET\Framework\framework_version\CONFIG
(for example, C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config)

<system.web> will already exist there, so you can just add the new node: <httpRuntime maxRequestLength=”20480″ />

Note that both of the examples above set the upload limit to 20MB.  The value is in Kilobytes, NOT Bytes like the IIS setting.

2 Replies to “File upload restrictions in Lucee”

Leave a Reply

Your email address will not be published. Required fields are marked *