Skip to main content

Hi!
I tried many different settings but no luck so decided to create new thread.

Using File Attachment control in SmartForm I can't upload *.pdf file 6.5MB. Error message what I got is "The file could not be uploaded. Unforseen error occured on the file upload, contact your administrator." In browser console I can see that 413 (Request Entity Too Large) error is thrown.

 

I'm using K2 Five 5.5.
Tried to install latest CU and FixPack - No luck;
Tried to edit runtime and designer Web.Config files with those settings:
<add key="Forms.Designer.Controls.Attachment.MaxSize" value="2097151"/>
<httpRuntime maxRequestLength="2097151" requestValidationMode="2.0" enableVersionHeader="false" sendCacheControlHeader="false" executionTimeout="9999" /> - no luck;
Tried to edit IIS "upladReadAheadSize" to value - 2147483647 - no luck.

 

No error entries in logfile.
*.pdf is in allowed file types.

 

Can someone suggest something else to solve this issue?

Is it possible that it is IIS that is blocking this and not K2? See if this applies to you: https://www.inflectra.com/support/knowledgebase/kb306.aspx

Thank you for your replay. Yes I tried, but it does not help.


I noticed that problem occurs with any of allowed file types with size more than 1 MB. Anything less of that is ok.


I do think it is some setting on your server (Windows or IIS setting) and not K2 that is blocking this. K2 has a different message that appears if you hit its file size limitations. Sorry I do not have more specifics but I hope that gives you a little bit of direction.

Hello Arnis,



Could you perhaps check if the maxAllowedContentLength setting exists in the Designer and Runtime web.config files?



 



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



 



If so, the minimum value of the 2 settings below takes precedence so both settings have to be increased. 



1. maxRequestLength -  Specifies the limit for the buffering threshold of the input stream, in kilobytes.



2. maxAllowedContentLength (IIS Request filtering) - Specifies the maximum length of content in a request, in bytes.



 



See Considerations section in our documentation: https://help.nintex.com/en-US/k2five/userguide/5.5/default.htm#Create/K2Designer/Controls/FileAttachment/FileAttachmentControl.htm



 



 


Hello Kimberly,



Thank you for your replay and idea.



 



In Designer and Runtime web.config files there is no "maxAllowedContentLength" setting available.



I have tried to add "2147483648" value in IIS Request Filtering Settings for "Maximum allowed content length" for both of sites (Designer and Runtime) - No luck.


Hi Arnis,



 



I found an article online for the 413 (Request Entity Too Large) error you are seeing:



https://techcommunity.microsoft.com/t5/iis-support-blog/solution-for-request-entity-too-large-error/ba-p/501134



 



It seems IIS has a limit for the size of files uploaded. The default value is 49 KB which is equivalent to 49152 Bytes. This probably explains why uploading file sizes more than 1MB is not working. 



 



Could you try increasing the uploadReadAheadSize value for the K2 site and check whether IIS still returns a 413?


Hi Kimberly,



 



Yes I have been found this thread too. I have tried maximum value - 2147483647 and values between default and maximum. It does not change error in browser, Error 413 is still there.



 



As this setting is applying on every new session, I have cleared browser cache and even tried to upload files from different workstations. It's the same on every machine.


Found a solution for this problem.



As the K2 server is published behind reverse proxy (Nginx) problem was in reverse proxy settings. Increased max allowed file size in Nginx settings, and problem is solved.


Reply