Restricting video uploads using extension and MIME types

RichTextEditor has the capability to allow or restrict uploading video files by extensions and types. You can filter the type of video files you want to upload so only specified file types are allowed.

RichTextEditor also automatically detect the MIME type of the files you upload, and rejects the file if the file-extension does not match the mime type ("The file is corrupt or has an incorrect extension"). If you want to upload uncommon types of files, you may need to add the appropriate information into the security policy files:

How to allow or restrict uploading video files by extensions and types?

You can allow or restrict uploading video files by extensions and types using the following methods:

Edit security policy file

The security policy file (default.config, admin.config and guest.config) can be found in the richtexteditor/config folder. In security policy file you can find the following code which defines allowed video file extensions within RichTextEditor. You can modify this settings to meet your own requirements.


<category for="Video">
       <security name="Extensions">*.swf,*.flv,*.avi,*.mpg,*.mpeg,*.mp3,*.wmv,*.wav,*.mp4,*.mov</security>
</category>

Programmatically validate file type and file extension when uploading

RichTextEditor provides a powerful method named Editor.SetSecurity that allows you programmatically manage the security settings.

Editor1.SetSecurity("Video", "default", "Extensions", "*.swf,*.flv,*.avi,*.mpg,*.mpeg");

Send feedback about this topic to CuteSoft. © 2003 - 2018 CuteSoft Components Inc. All rights reserved.