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:
- File upload size limit: 4MB
- 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:
- 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.
- 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)