Increase the Teleric Editor Max Upload File Size
Last Post 3/8/2012 2:00 PM by Deleted User. 0 Replies.
Author Messages
Deleted User
New Member
New Member
Posts:62


--
3/8/2012 2:00 PM  

http://www.dotnetnukefool...ge-file-uploads.aspx

Increasing the HTML Editor’s Max File Size


For DNN 5.x – you get to do it manually

You have to edit the go to \Providers\HtmlEditorProviders\Telerik\Config\ConfigDefault.xml file and edit it. COPY IT and give your copy a unique name like “RobbsConfig.xml” or something. The ConfigDefault.xml gets overwritten on each upgrade – so any changes you make there will be lost – that’s why you copy it and edit your copy Smile. Now edit YOUR copy of the file and change your MaxUploadFileSize’s to what you want. Note that there are several of them that you want to hit. The numbers are in BYTES, so count off 1,024,000 = 1MB.

4MBDefault

Now that you’ve changed your settings you need to change the web.config to use your file instead of the default. Open the web.config and find the setting sections for the htmlEditor.

<dotnetnuke>
<htmlEditor defaultProvider="TelerikEditorProvider">
<providers>
<clear />
<add name="FckHtmlEditorProvider" type="DotNetNuke.HtmlEditor.FckHtmlEditorProvider.FckHtmlEditorProvider, DotNetNuke.FckHtmlEditorProvider" providerPath="~/Providers/HtmlEditorProviders/Fck/" CustomConfigurationPath="~/Providers/HtmlEditorProviders/Fck/custom/FCKConfig.js" EnhancedSecurityDefault="false" SecureConfigurationPath="~/Providers/HtmlEditorProviders/Fck/custom/FCKConfigSecure.js" ImageGalleryPath="~/Providers/HtmlEditorProviders/Fck/fckimagegallery.aspx" ImageUploadPath="~/Providers/HtmlEditorProviders/Fck/fckimagegallery.aspx" ImageAllowedFileTypes="gif,png,bmp,jpg" FlashGalleryPath="~/Providers/HtmlEditorProviders/Fck/fckimagegallery.aspx" FlashUploadPath="~/Providers/HtmlEditorProviders/Fck/fckimagegallery.aspx" FlashAllowedFileTypes="fla,swf" LinksGalleryPath="~/Providers/HtmlEditorProviders/Fck/fcklinkgallery.aspx" DynamicStylesGeneratorPath="~/Providers/HtmlEditorProviders/Fck/FCKStyles.aspx" DynamicStylesCaseSensitive="true" DynamicStylesGeneratorFilter="controlpanel|filemanager|mainmenu|wizard" StaticStylesFile="~/Providers/HtmlEditorProviders/Fck/FCKeditor/fckstyles.xml" StylesDefaultMode="Static" DynamicCSSGeneratorPath="~/Providers/HtmlEditorProviders/Fck/FCKCSS.aspx" StaticCSSFile="~/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/css/fck_editorarea.css" CSSDefaultMode="static" spellCheck="ieSpell" AvailableToolbarSkins="Office2003,Silver" DefaultToolbarSkin="Office2003" AvailableToolBarSets="DNNDefault,Default,NoGallery,Basic" DefaultToolbarSet="DNNDefault" DefaultImageGallerySkin="Default" DefaultFlashGallerySkin="Default" DefaultLinksGallerySkin="Default" FCKDebugMode="false" UseFCKSource="false" OptionsOpenMode="ShowModalDialog" CustomOptionsDialog="Admin" />
<add name="TelerikEditorProvider" type="DotNetNuke.HtmlEditor.TelerikEditorProvider.EditorProvider, DotNetNuke.HtmlEditor.TelerikEditorProvider" providerPath="~/Providers/HtmlEditorProviders/Telerik/" toolsFile="~/Providers/HtmlEditorProviders/Telerik/Config/ToolsDefault.xml" configFile="~/Providers/HtmlEditorProviders/Telerik/Config/ConfigDefault.xml" FilterHostExtensions="True" />
</providers>
</htmlEditor>
What you want to change is the portion of the TelerikEditorProvider line…
configFile="~/Providers/HtmlEditorProviders/Telerik/Config/ConfigDefault.xml"
And change it to use your file. One thing to note… this will be reset after every upgrade – so you need to repeat this last bit every time you do an upgrade.

for DNN 6.x your life is easy

htmleditorSomeone listened along the way and added an HTML Editor Manager in 6.x so that we didn’t have to edit the files manually. Log in as a host/superuser and click on Host…”HTML Editor Manager”… then under the “Default Configuration” click on “Everyone”.



filesizeNow Expand the respective Manger settings and change your max file size. You will want to change the settings on *at least*;

Document Manager
Image Manager
Media Manager
Allowing the Website to accept larger Files

Now that you’ve allowed the Editor to accept larger files you still have to tell the ASP.NET application pool to accept larger files. The only way to do that is to jump into the web.config file.

Edit the web.config and look for the line that starts with…

<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="8192" requestLengthDiskThreshold="8192" />
The maxRequestLength is measured in KB, so 8192 = 8MB. Increase this to accommodate the larger filesizes you want to support.

The requestLengthDiskThreshold is also measures in KB and is how much data is stored in memory before writing that memory to disk. It’s not abnormal to make it the same as your maxRequestLength. If you are supporting REALLY LARGE files I would set this to something less than 40MB - this will keep your website from gobbling up memory.

While you are on that line, I suggest adding an option for executionTimeout , that is measured in seconds and represents how long the website will wait for you to upload a file or interact with it. I usually set executionTimeout=600 (that’s 10min).

My final line looks like…

<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="40960" requestLengthDiskThreshold="40960" executionTimeout="160" requestValidationMode="2.0" />
Thought you were done? Not if your on IIS 7

So, you thought you were done? Nope… If you are in IIS7 there is one little security issue that you might have to deal with. In *some* environments IIS7 where request filtering is installed for security reasons IIS is setup to only accept content less than 28.6MB. This restriction is often in place to block from Denial of Service Attacks on websites that allow the public to upload files. (If I have the requestLengthDiskThreshold set to 40MB and have 100 people uploading huge files – I could potentially tie up 4GB of RAM). You don’t have to worry about this in most cases (unless the public is uploading files).

We can override that setting by finding/adding the <requestFiltering> section of the web.config.

<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="300000000" />
</requestFiltering>
</security>
</system.webServer>
Note that this value is in BYTES and needs to be larger than your normal allowed length. Don’t set it to the same size as your limits. If you set this to lower or equal to the max file site limit your users will be summarily disconnected and not shown an error. Setting the value to a larger than max file size setting will allow DotNetNuke to throw the appropriate error and keep you from troubleshooting a ghost Smile




---