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
   Infor CRM (formerly Saleslogix) Web- Dependency Lookup OnChange Event Not Working Correctly
In the Saleslogix 8.1 web client the dependency lookup still has a problem with the OnChange event. 
Posted on Nov 26, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Confirming Actions With an "Are you sure?" Prompt in Infor CRM (Saleslogix)
I'm not a huge fan of bugging end users. I figure, if an end user clicked something, he or she meant
Posted on Nov 18, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Manipulating the DependencyLookup Control in the Infor CRM Web Client (Formerly Saleslogix)
 The Dependency Lookup control in the Saleslogix web client is what is used for the hierarchical Are
Posted on Nov 14, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Infor CRM (formerly Saleslogix) Statement of Direction
Learn more about the future of Infor CRM. Recently I received my login information for the Infor Partn
Posted on Nov 13, 2014 by Brianna Ojard to The Inbox
 
   Adding a report link to the Common Tasks pane in Infor CRM (formerly Saleslogix)
When you are viewing an Entity Detail page, the Common Tasks pane on the right of the page provides a nu
Posted on Nov 12, 2014 by Jason Buss to Jason Buss' Blog
 
Comments

 

Phil Parkin said:

Hi Ryan

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

Cheers
Phil
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. ;-)

Thanks.
-Ryan
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.

Thanks!

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

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 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