Login / Register  search  syndication  about

          Ryan Farley's Blog

Ryan Farley on .NET Development with a focus on CRM Development for SalesLogix

Changing the File Size Limit for Uploaded Attachments for SalesLogix 7.2 Web

One of the great things about the new SalesLogix Web architecture is that it is all built on ASP.NET - using standard ASP.NET techniques. With our knowledge of ASP.NET, we can make many useful changes to SalesLogix since it all 100% applies. No tricky or proprietary things to figure out, just plain old ASP.NET.

A customer reported a problem today from a customer portal user who was getting a timeout when trying to upload a 2MB file as an attachment to a ticket. By default, any ASP.NET application will have the following limits:

  1. File upload size limit: 4MB
  2. Execution timeout: 90 seconds

For this case, it was obviously the execution timeout that caused the error. The user's connection speed prevented the 2MB file to be uploaded within that 90 second window. While the 90 seconds may be OK for a local networked user to attach a (up to) 4MB file, it is likely not long enough for someone on the outside with a slower connection speed before a timeout will occur.

However, these settings can all be easily modified. To modify these settings, you’ll need to modify the web.config file for the portal. You can do this on the deployed file directly to test and when you have the settings that you want, make the same change in the web.config file, located in the “Support Files” section, for the appropriate portal in the AA so the changes are not lost each time you deploy. The section to look for in the web.config is “httpRuntime“. Search through the file to locate this node. It will have two attributes you’ll want to consider changing:

  1. executionTimeout - This is the number of seconds any operation can take before it is assumed to have failed (timed out) and terminated. You’ll want to increase this to a reasonable amount of seconds to upload the maximum file size. If the file cannot be uploaded in the number of seconds specified here it will fail.
  2. maxRequestLength - This is the maximum file size, in kilobytes, that can be uploaded in the request stream to the server. For example, to set this limit to 10MB, you'd set the value to “10240“. Obviously, the bigger the value here the higher executionTimeout you'll want to set.

Once you’ve made the changes, save the file. Keep in mind, you should use caution when making web.config changes to a live, in production site. Any changes to the web.config file will cause the ASP.NET application to recycle. This has a potential to cause problems for users (it’s sort of like an IISRESET at the application level). Also, use caution with the maxRequestLength you set. Don't go too crazy and set a really high one for no reason. Setting a high limit here can put you at some risk for attacks from hackers (some attacks will consist of throwing a large number of large requests at the site. To guard against this, you can decrease the size of the files that are allowed to be uploaded, limiting the size of the requests that can be sent to the site)

What's This?
Bookmark and Share

About Ryan Farley

   Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

View the SalesLogix Mobile Seveloper Series
View the SalesLogix SData Developer Series
View the Git for the SalesLogix Developer series

Related Content
   Can I Bind an Attachment to a Specific Activity in Infor CRM version 7.54?
Recently I had a user ask if they could bind an attachment to a specific Activity within Infor CRM??
Posted on Jul 07, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) Iterating through all tabs on a Page
 Using the TabWorskpace you can iterate through all the tabs on a page and do something with them, l
Posted on Jun 19, 2015 by Kris Halsrud to Kris Halsrud's Blog
   Infor CRM (Formerly Saleslogix) Hiding Tabs at Runtime Without Using Modules
 As Ryan wrote a long time ago, you can create a module and add it to a page in the Infor CRM web cl
Posted on Jun 10, 2015 by Kris Halsrud to Kris Halsrud's Blog
   How I assign ownership to a group of Leads in Infor CRM?
There is a tool within Infor CRM to align Accounts to different Account Owners. It is called Territory Re
Posted on Jun 05, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) Adding a Client Side Confirmation on a Dependency Lookup in the Web Client
 We recently had a client who wanted to have a user confirmation prompt before a user was allowed to
Posted on May 28, 2015 by Kris Halsrud to Kris Halsrud's Blog


Phil Parkin said:

Hi Ryan

Surely the figure would be 10 485 760 for 10MB?

January 3, 2008 3:22 PM

Ryan Farley said:

Hi Phil,

Thanks for catching that. You are correct - but you actually made me notice a bigger typo in the post. The maxRequestLength is in kilobytes, not bytes. Glad you mentioned the mistyped value. ;-)

January 4, 2008 10:37 AM

Gaurav said:

Is it possible to upload more than 4 MB image without changing web config file?

February 28, 2012 3:26 AM

Greg Herman said:

It's possible to do this in the AttachmentList.ascx/.cs file as well and to provide an even better warning message.

The radU:RadUpload control (at least in v7.5.4) handles this on the .aspx:

<radU:RadUpload ReadOnlyFileInputs="true" ID="uplInsertUpload" runat="server" InitialFileInputsCount="1" EnableViewState="true"

                       EnableFileInputSkinning="True" ToolTip="<%$ resources: uplInsertUpload.ToolTip %>" ControlObjectsVisibility="None"

                       Skin="Slx" SkinsPath="~/Libraries/RadControls/upload/skins" OnClientAdded="IncreaseFileInputWidth" Width="500px" MaxFileSize="10000000" MaxFileInputsCount="1" />

Here you can set MaxFileSize and MaxFileInputsCount directly.

in the .cs once the error is reported by the RadUpload control you can catch the error and display a better message (in cmdUpload_Click):

if (uplInsertUpload.InvalidFiles.Count > 0 && uplInsertUpload.InvalidFiles[0].ContentLength > 10000000)


DialogService.ShowMessage("some message");


Of course, as Ryan says, this is all limited by the web.config....  You can't set a value here that's greater than the web.config.  Also, becasue of how the control works, the upload has to start before it realizes how big the file is.  It will by default only fail once it reaches the upload limit -- I haven't found a way to get file size from the client and restrict prior to uploading...  

August 9, 2012 4:43 AM

PieInTheSky said:

Hi Greg,

one of our agents got the following warning: "Warning: This request may exceed the limit set by your administrator and fail to upload. Would you like to continue?"

Do you know where I can change this warning?

January 8, 2013 3:32 AM

Thiha said:

Hi PieInTheSky,

Takes a look sage-desktop.js. There you can find the Warning message you got. Simply just changes the if statement and dun forget to change the related codes in sage-common.js file.


April 7, 2013 12:04 PM

Zoran said:

Thanks Ryan, very helpful.

June 5, 2013 8:06 PM

PieInTheSky said:

Hi Thiha,

thanks! Now I can finally translate the error message for our users :D

August 21, 2013 4:09 AM

Leave a Comment

All contents Copyright © 2015 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register