Modify RadEditor for sharepoint Max file size allowed 200KB to more Size

本文介绍如何通过修改Telerik RadEditor的配置文件来调整图片、文档等的最大上传尺寸及允许的文件类型。此外,还说明了如何使用ConfigFile属性简化多个编辑器的配置管理。

if some need to modify Max file size

 

it's possible by setting the MaxImageSize property in the Configuration file(

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\4.5.6.0__1f131a624888eeed\RadControls\Editor\ConfigFile.xml

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\4.5.6.0__1f131a624888eeed\RadControls\Editor\ListConfigFile.xml

).

There you can also set the allowed document's extensions

<property name="MaxImageSize">204800</property> 

<property name="DocumentsFilters"> 
<item>*.doc</item> 
<item>*.pdf</item> 
</property>

 

<property name="MaxImageSize">204800</property>      
<property name="MaxFlashSize">102400</property>      
<property name="MaxMediaSize">5242880</property>     
<property name="MaxDocumentSize">512000</property>       
<property name="MaxTemplateSize">204800</property>

 

The MaxImageSize property is in bytes and its default value is 204800 (200KB). You can set it to anything you like as long as it's not over the MaxRequestLength value set in the MOSS web.config file (51 MB). For example, if you want to upload 10 MB images, set MaxImageSize to 10485760.

As for the metadata, I can confirm that the upload function in the built-in editor dialog does not allow you to set any additional information for the file. You can do this only if you open the file from the image library.

 

Using The ConfigFile.xmlSend comments on this topic.
 Language Filter: All

Telerik RadEditor can use ConfigFiles. These are XML files, which contain the whole configuration of the component. They can be shared among multiple editors and thus make group re-configuration extremely easy. In case you want to manage a number of identical editors at once you can just set them to use one ConfigFile and modify only that file when needed.

 

Moreover, you can still tweak individual editors by setting certain properties directly in the Telerik RadEditor tag, as those will override the properties defined in the ConfigFile.

 

IMPORTANT: The ConfigFile property does not have a default value set. This means that you must point the ConfigFile property to the configuration file that you intend to use. For example if you want to use the default configuration file that comes with the Telerik RadEditor's distribution, you must set ConfigFile="~/RadControls/Editor/ConfigFile.xml"



 

Below is an example of a simple ConfigFile:

ConfigFile.xml
< configuration >
     
< property  name = "ToolbarMode"> Default </ property >
     
< property  name = "UseClassicDialogs">  false </ property >
     
< property  name = "NewLineBr">  true </ property >
     
< property  name = "ToolsFile"> ~/RadControls/Editor/ToolsFile.xml </ property >
     
< property  name = "Skin"> Default </ property >
     
< property  name = "SaveAsXhtml"> false </ property >
     
< property  name = "AllowThumbGeneration">  true </ property >
     
< property  name = "ImagesPaths">
        
< item >  ~/Img/ </ item >
     
</ property >
     
< property  name = "UploadImagesPaths">
        
< item >  ~/Img/ </ item >
     
</ property >
     
< property  name = "DeleteImagesPaths">
        
< item >  ~/Img/ </ item >
     
</ property >
     
< property  name = "Language"> en-US </ property >
</
configuration >

 

As a result, the <RadEditor> tag can be reduced to the following:

ASPX
< rad:RadEditor  id = "editor1"  runat = "server"
  
ConfigFile =  "~/RadControls/Editor/ConfigFile.xml">
</
rad : RadEditor >

The "~" tilde symbol represents your web application root directory
 

ConfigFile structure:

The ConfigFile must have a valid structure as shown below.

Note, that all items are case sensitive!

 

ConfigFile.xml
< configuration >
   
< property >
        
< item >
         
...
        
</ item >
        
< item >
         
...
        
</ item >
        
...
   
</ property >
   
...
</ configuration >
 
"property" element valid attributes:
name(required):
ToolbarModeToolsFileSkinAllowCustomColorsSaveAsXhtmlWidth
HeightStripAbsoluteImagesPathsStripAbsoluteAnchorPathsStripFormattingOnPasteAllowThumbGenerationThumbSuffix
ToolsHeightHtmlImagesPathToStripImagesPathsDeleteMediaPathsUseClassicDialogs
EditableMaxTemplateSizeMaxImageSizeMaxFlashSizeMaxDocumentSizeMaxMediaSize
ShowHtmlModeShowPreviewModeNewLineBrAllowScriptsOnFileUploadOnFileDelete
UploadImagesPathsDeleteImagesPathsFlashPathsUploadFlashPathsDeleteFlashPathsMediaPaths
UploadMediaPathsDocumentsPathsUploadDocumentsPathsDeleteDocumentsPathsDocumentsFiltersMediaFilters
EnableHtmlIndentationEnableEnhancedEditEnableContextMenusUseFixedToolbarConvertTagsToLowerAnchorPathToStrip
TemplatePathsUploadTemplatePathsDeleteTemplatePathsTemplateFiltersCookieExpirationTimeLanguage
ImagesFilters FileEncodingSaveInFileCssFilesCausesValidationHasPermission
LicenseFileShowSubmitCancelButtonsStripFormattingOnPasteSpellWordIgnoreOptionsSpellCheckProviderSpellDictionaryLanguage
SpellAllowAddCustomSpellCustomDictionarySourceTypeNameSpellCustomDictionarySuffixSpellDictionaryPathSpellEditDistanceSpellFragmentIgnoreOptions
AnchorPathToStripImagesPathToStripConvertFontToSpanConvertToXhtmlThumbSuffixToolbarMode
 
"item" element valid attributes:
 (item elements should appear as child elements of a property element with "name" attribute set to:
 "ButtonsStyle", "ImagesPaths", "UploadImagesPaths", "DeleteImagesPaths",
 "FlashPaths", "UploadFlashPaths", "DeleteFlashPaths", "MediaPaths", "UploadMediaPaths",
 "DeleteMediaPaths", "DocumentsPaths", "UploadDocumentsPaths", "DeleteDocumentsPaths",
 "DocumentsFilters", "MediaFilters", "TemplatePaths", "UploadTemplatePaths", "DeleteTemplatePaths",
 "TemplateFilters", "MaxTemplateSize")

  

IMPORTANT: If you are upgrading from a previous version of Telerik RadEditor, make sure that you remove all deprecated properties from the XML ConfigFile, otherwise the application will throw an exception.

 

转载于:https://www.cnblogs.com/Areas/archive/2012/10/29/2744325.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值