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
   CRITICAL Issue with Saleslogix v8.1 Web SNC 02- Breaks Compatability with SQL 2008R2
One of the listed fixes in SNC 02 for Saleslogix 8.1 is listed as:14095222 Enhance the SQL generation to
Posted on Apr 17, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Editing Filters in Saleslogix Web Client 8.0
Is it possible to add or remove Saleslogix filters from the List view in Accounts?
Posted on Apr 08, 2014 by SalesLogix Support to SalesLogix Questions & Answers
 
   Bug in the Saleslogix Web LiveGrid Lookup dialog
I recently ran into an issue with the Opportunity Products grid in the Saleslogix web client.  I cli
Posted on Apr 04, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix Web Client Controls are Missing
Every so often we hear that a user can no longer add products to an opportunity whether it is a new oppor
Posted on Mar 24, 2014 by Mark Duthoy to SalesLogix Support
 
   Major Problem in Saleslogix v8.1 Cloud Instances
I have been working with a new client who is on the hosted cloud solution for Saleslogix version 8.1.&nbs
Posted on Mar 19, 2014 by Kris Halsrud to Kris Halsrud's 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