Custom Broker - Max File Size that can be transferred


Dear Members,

Am having a custom broker , in which I use a SO method to retrieve the attached file from the file control and upload it to a share drive.

 

This works fine for 400 MB , when i try to attach 800 MB , File Data(File Content) gets null in my service broker code

Sample Code

Property p = ServiceBroker.Service.ServiceObjects[0].Properties["FileData"];

p.value gets null

 

I tried changing several configuration in runtime config(maxRequestLength, maxAllowedContentLength) , but these seems to help only on smartform level not in service broker.

 

My question is , whether we have any separate file size limit for service broker communication, is it possible to increase this?

Please help me on this if you know any relevant information on this


7 replies

Hi,

 

Try to chagne timeout in service intstance configuration.

Hi Manik,


 


Aside from adding the following in the SmartForms runtime webconfig, 


<requestLimits maxAllowedContentLength="1073741824" />


 


The max. value 4294967295 bytes (4 GB).


 


Please also increase the execution timeout on the service broker.


 


K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member.

Hi lkimberly,

Thank you for your response

 

I have set the following in Rumtime config

<requestLimits maxAllowedContentLength="2147483648" />

 

Increased the execution timeout as follows

<httpRuntime maxRequestLength="2097152" requestValidationMode="2.0" enableVersionHeader="false" sendCacheControlHeader="false" executionTimeout="2000" />

 

Increased the command timeout in K2HostServer config as follows

<sourcecode.smartobjects.runtime smartObjectDependencyClassId="9812F4EA-75C9-48C1-83DB-578FCCE0CBC7" smartObjectServicesDependencyClassId="BB0633*personal details removed*A7B-4849-BE*personal details removed*CDF511DC91" smartObjectServicesTypeDependencyClassId="EA60367A-5E*personal details removed*F64-E1E494A77675" servicebrokerpath="D:Program Files (x86)K2 blackpearlServiceBroker" bufferrecords="20000" commandtimeout="300" allowexponent="false">

 

Restarted the K2 service & IIS , but it didnt work :-(

Hi K2 Developer

 

Please do the following edits:-


I had problem with adding files >20MB all I had to do was change web.config in k2 smartforms runtime and designer.

I made 2 changes:

1) change max file size that can be uploaded to file data file attachment i set it at 200MB by changing: filemaxRequestLength="204800" 

in this case max size must be given in kilobytes

2) change max allowed content size that can be stored:

<requestFiltering allowDoubleEscaping="true" /> 

With this: 

<requestFiltering allowDoubleEscaping="true">
    <requestLimits maxAllowedContentLength="209715200" />
</requestFiltering>

in this case max size must be given in bytes

 

Best Regards;

Widson.

 

Should you find this information useful please mark it as “Accepted Solution and/or Kudo” as it will assist other people in future.

 

[K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]

Hi Widson,

Thank you for the response

My Runtime web.config settings is as follows (this is my settings even before this issue)

 

<httpRuntime maxRequestLength="2097152" requestValidationMode="2.0" enableVersionHeader="false" sendCacheControlHeader="false" executionTimeout="2000" />


<requestLimits maxAllowedContentLength="2147483648" />

 

but the above settings helped me only in Smartform level to upload large file , but am getting the issue in custom service broker code.

 

Hi K2 Developer

 

Please Note that "The value of the Max Size property should always be lesser or equal to the value of the MaxRequestLength setting in the


<install drive>:Program Files (x86)K2 blackpearlK2 smartforms DesignerWeb.config ", I suggest that you equalize all the altered sizes and no need to restard the iis service, just save the web.config file after that.

You're also welcome to browse this source for more information http://help.k2.com/onlinehelp/k2forsharepoint/userguide/4.7/default.htm#sf-viewcontrols-imageattachmentwithprogress.html

 

The following is an alternative:-

You can use this service broker, make edits and suit your needs it's tested with 4.7 and 5.1 versions, 

This is a service broker which allows you to perform the following functions (https://community.k2.com/t5/K2-blackpearl/File-Service-Broker-v2-0/ba-p/92469?nobounce)

  • Upload a file to a file folder or server share
  • Read a file from a directory
  • Delete a file based on the file path
  • Get the list of files in the directory
  • Gets the list of folders in the directory

 

Should you find any relevant useful kindly mark it as "Kudo and/or Accepted Solution", to help others in future investigations.

 

Regards;

Widson.

 

[K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]

Hi Widson,
Thank you for your response again
These are my current config settings
Max Size in the attachment control properties : 2048576000
Runtime Web.Config
<!--<add key="Forms.Designer.Controls.Attachment.MaxSize" value="5120" />--> - its commented
<httpRuntime maxRequestLength="2048576000" requestValidationMode="2.0" enableVersionHeader="false" sendCacheControlHeader="false" executionTimeout="2000" />
<requestLimits maxAllowedContentLength="2048576000" />
Designer Web.Config
<!--<add key="Forms.Designer.Controls.Attachment.MaxSize" value="5120" />--> - its commented
<httpRuntime maxRequestLength="2048576000" requestValidationMode="2.0" enableVersionHeader="false" sendCacheControlHeader="false" executionTimeout="2000" />

That still didn't help

I also tried using the File Service service broker, for some reason its not working on my environment(4.7), not able to create a service instance, so am trying to fix the same and give it a try. :-)

Reply