Skip to main content
Nintex Community Menu Bar

How to increase default file size limit for File Attachment Control in K2 SmartForms

  • September 11, 2016
  • 3 replies
  • 225 views

Forum|alt.badge.img+11


 

Symptoms

 


Sometimes it may be necessary for you to increase maximum allowed attachment size for K2 SmartForms. There is a section in K2 Appit documentation which covers File Attachment Control settings and limit configuration thoroughly:

 

K2 Appit

 

http://help.k2.com/onlinehelp/k2appit/userguide/current/default.htm#sf-viewcontrols-fileattachmentwithprogress.html

 

But K2 Appit has slight differences with on-prem K2, and in this specific case, for example, you won't be able to find Allowed Type and Max Size properties exposed in design time control properties in on-prem version of K2 SmartForms. And there is no similar documentation section for K2 SmartForms on-prem.
 

 

Diagnoses

 


This limit can be increased on the K2 SmartForms Runtime site level by means of editing runtime web.config file. There are 2 relevant settings which have to be increased. These settings work in combination and one which set to smaller value takes precedence.

 

 

 

1) maxRequestLength This setting should present by default in your web.config. Just locate it and adjust its value in kilobytes. Example below shows how to set this limit to be 50MB (once again, value has to be specified in kilobytes):

 

 

 

<httpRuntime maxRequestLength="51200" /> <!--50MB-->

 

 

 

2) maxAllowedContentLength This setting does not exit in SmartForms Runtime web.config by default and it has to be added in appropriate place. Its value has to be specified in bytes. Example below shows how to set this limit to be 50MB:

 

 

 

<requestLimits maxAllowedContentLength="52428800" /> <!--50MB-->

 

 

 

Locate <requestFiltering allowDoubleEscaping="true" /> line in your config file and remove closing slash from this line, then add two more lines below so that in conjunction with this edited line it looks as follows:

 

 

 

<requestFiltering allowDoubleEscaping="true">

 

<requestLimits maxAllowedContentLength="52428800" /> <!--50MB-->

 

</requestFiltering>

 

 

 

You don't need to perform IIS reset to apply these changes just edit and save web.config file.
 

 

Resolution

Apply relevant settings by means of editing K2 SmartForms runtime web.config as described above.

 

 



 

3 replies

OlivierC
Nintex Employee
Forum|alt.badge.img+6
  • Nintex Employee
  • June 28, 2021

Note: the error message when the file exceed the value maxAllowedContentLength is:

 

File Not Uploaded

"The file attachment exceeds the maximum size of 51200 KB.


Forum|alt.badge.img+1
  • Rookie
  • October 9, 2024

Hello, I’m trying to follow this guide but which web.config file needs to be edited? How do I find the right one?

Thanks


Forum|alt.badge.img
  • Nintex Employee
  • February 20, 2025

Hello, I’m trying to follow this guide but which web.config file needs to be edited? How do I find the right one?

Thanks

SmartForms Runtime:
[K2 installation folder]\K2 smartforms Runtime\Web.config

If C:\Program Files\K2 is where K2 is installed: 
C:\Program Files\K2\K2 smartforms Runtime\Web.config

Remember: Back up the Web.config before changing