Ckeditor3.6.2 and ckfinder2.2.1 for ASP. NET deployment settings perfect solution (3)

Source: Internet
Author: User

6. Configure ckfinder

Modify the admin \ ckfinder \ config. ascx file. The content is as follows (there are two modifications in it. Please search for the word "modify ):

<% @ Control Language = "C #" enableviewstate = "false" autoeventwireup = "false" inherits = "ckfinder. settings. configfile "%> <% @ import namespace =" ckfinder. settings "%> <SCRIPT runat =" server ">/*** this function must check the user session to be sure that he/she is * authorized to upload and access files using ckfinder. */Public override bool checkauthentication () {// warning: do not simply return "true ". by Doing so, you are allowing // "anyone" to upload and list the files in your server. you must implement // some kind of session validation here. even something very simple... /// return (session ["isauthorized"]! = NULL & (bool) session ["isauthorized"] = true );////... where session ["isauthorized"] is set to "true" as soon as the // user logs on your system. return true; // modify: Here, false is changed to true, that is, no authentication check is performed. If you need to authenticate your identity, implement it on your own}/*** all configuration settings must be defined here. */Public override void setconfig () {// paste your license name and key here. if left blank, ckfinder will // be fully functional, In Demo mode. licensename = ""; licensekey = ""; // The base URL used to reach files in ckfinder through the browser. baseurl = "~ /Uploader/"; // modify: Specify the root directory of the upload management file, which is the Uploader directory in the root directory of the website, you do not need to create your own directory // The phisical directory in the server where the file will end up. if // blank, ckfinder attempts to resolve baseurl. basedir = ""; // Optional: Enable extra plugins (remember to copy. DLL files first ). plugins = new string [] {// "ckfinder. plugins. fileeditor, ckfinder_fileeditor ", //" ckfinder. plugins. imageresize, ckfinder_imageresize ",//" Ckfinder. plugins. watermark, ckfinder_watermark "}; // settings for extra plugins. pluginsettings = new hashtable (); pluginsettings. add ("imageresize_smallthumb", "90x90"); pluginsettings. add ("imageresize_mediumthumb", "120x120"); pluginsettings. add ("imageresize_largethumb", "180x180"); // name of the watermark image in plugins/watermark folderpluginsettings. add ("watermark_source", "logo.gif"); pluginse Ttings. add ("watermark_marginright", "5"); pluginsettings. add ("watermark_marginbottom", "5"); pluginsettings. add ("watermark_quality", "90"); pluginsettings. add ("watermark_transparency", "80"); // thumbnail settings. // "url" is used to reach the thumbnails with the browser, while "dir" // points to the physical location of the thumbnail files in the server. thumbnails. url = baseurl + "_ thumbs/"; if (B Asedir! = "") {Thumbnails. dir = basedir + "_ thumbs/";} thumbnails. enabled = true; thumbnails. directaccess = false; thumbnails. maxwidth = 100; thumbnails. maxheight = 100; thumbnails. quality = 80; // set the maximum size of uploaded images. if an uploaded image is // larger, it gets scaled down proportionally. set to 0 to disable this // feature. images. maxwidth = 1600; images. maxheight = 1200; images. quality = 80 ;// Indicates that the file size (maxsize) for images must be checked only // after scaling them. otherwise, it is checked right after uploading. checksizeafterscaling = true; // increases the security on an IIS Web server. // if enabled, ckfinder will disallow creating folders and uploading files whose names contain characters // that are not safe under an IIS 6.0 web server. disallowunsafecharacters = tru E; // due to security issues with Apache modules, it is recommended to leave the // Following setting enabled. it can be safely disabled on IIS. forcesingleextension = true; // for security, HTML is allowed in the first KB of data for files having the // Following extensions only. htmlextensions = new string [] {"html", "htm", "XML", "JS"}; // folders to not display in ckfinder, no matter their location. No // paths are accepted, only the folder name. // The * and? Wildcards are accepted. hidefolders = new string [] {". SVN "," CVS "}; // files to not display in ckfinder, no matter their location. no // paths are accepted, only the file name, including extension. // The * and? Wildcards are accepted. hidefiles = new string [] {". * "}; // perform additional checks for image files. secureimageuploads = true; // The session variable name that ckfinder must use to retrieve the // "role" of the current user. the "role" is optional and can be used // In the "accesscontrol" Settings (bellow in this file ). rolesessionvar = "ckfinder_userrole"; // ACL (Access Control) settings. used Restrict access or features // to specific folders. // Several "accesscontrol. add () "callcan be made, which return a // single ACL setting object to be configured. all properties settings // are optional in that object. // subfolders inherit their default settings from their parents 'Definitions. ///-the "role" property accepts the special "*" value, which means // "everybody ". //-the "resourcetype" Attribute accepts the special value "*", which // means "all resource types ". accesscontrol ACL = accesscontrol. add (); ACL. role = "*"; ACL. resourcetype = "*"; ACL. folder = "/"; ACL. folderview = true; ACL. foldercreate = true; ACL. folderrename = true; ACL. folderdelete = true; ACL. fileView = true; ACL. fileupload = true; ACL. filerename = true; ACL. filedelete = true; // resource type settings. // a resource type is n Othing more than a way to group files under // different paths, each one having different configuration settings. // each resource type name must be unique. // when loading ckfinder, the "type" querystring parameter can be used // to display a specific type only. if "type" is omitted in the URL, // The "defaultresourcetypes" settings is used (may contain the/resource type names separated by a comma ). If left empty, all types // are loaded. defaultresourcetypes = ""; resourcetype type; type = resourcetype. add ("Files"); type. url = baseurl + "files/"; type. dir = basedir = ""? "": Basedir + "files/"; type. maxsize = 0; type. allowedextensions = new string [] {"7z", "AIFF", "ASF", "Avi", "BMP", "CSV", "Doc", "docx ", "FLA", "FLV", "GIF", "GZ", "gzip", "Jpeg", "jpg", "mid", "mov", "MP3 ", "MP4", "MPC", "MPEG", "MPG", "ODS", "ODT", "pdf", "PNG", "ppt", "pptx ", "pxd", "QT", "Ram", "RAR", "RM", "RMI", "rmvb", "rtf", "SDC", "sitd ", "SWF", "SXC", "Sxw", "tar", "tgz", "TIF", "tiff ", "TXT", "sealing", "WAV", "WMA", "WMV", "xls", "XLSX", "Zip"}; type. deniedextensions = new string [] {}; type = resourcetype. add ("Images"); type. url = baseurl + "images/"; type. dir = basedir = ""? "": Basedir + "images/"; type. maxsize = 0; type. allowedextensions = new string [] {"BMP", "GIF", "Jpeg", "jpg", "PNG"}; type. deniedextensions = new string [] {}; type = resourcetype. add ("Flash"); type. url = baseurl + "Flash/"; type. dir = basedir = ""? "": Basedir + "Flash/"; type. maxsize = 0; type. allowedextensions = new string [] {"SWF", "FLV"}; type. deniedextensions = new string [] {};}</SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.