ckeditor+ckfinder
官方地址:http://ckeditor.com/
复制ckeditor和ckfinder的文件夹到项目根路径下
拷贝ckfinder的config.xml到WEB-INF下
|
<config> <!-- CKFinder : Configuration File - Basic Instructions In a generic usage case, the following tasks must be done to configure CKFinder: 1. Check the baseDir and baseUrl options; 2. If available, paste your license key in the "licenseKey" setting; 3. Enable CKFinder using the "enabled" setting. WARNING : DO NOT simply set "enabled" to "true" on a production site. By doing so, you are allowing "anyone" to upload and list the files in your server. You must implement some kind of session validation. http://docs.cksource.com/CKFinder_2.x/Developers_Guide/Java/Configuration/Extending --> <enabled>true</enabled> 开启文件上传 <!-- Configure the location of uploaded files. See the following article for more details: http://docs.cksource.com/CKFinder_2.x/Developers_Guide/Java/Configuration/baseURL_and_baseDir --> <baseDir></baseDir> <baseURL>/house/userfiles/</baseURL> 上传路径 <licenseKey></licenseKey> <licenseName></licenseName> <!-- 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. --> <imgWidth>1600</imgWidth> <imgHeight>1200</imgHeight> <imgQuality>80</imgQuality> <!-- See the following article for more details: http://docs.cksource.com/CKFinder_2.x/Developers_Guide/Java/Configuration/URI_Encoding --> <uriEncoding>UTF-8</uriEncoding> <!-- ResourceType : defines the "resource types" handled in CKFinder. A resource type is nothing 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. maxSize is defined in bytes, but shorthand notation may be also used. Available options are: G, M, K (case insensitive). 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals one Gigabyte. Example: 'maxSize' => "8M", ============================================================================== ATTENTION: Flash files with `swf' extension, just like HTML files, can be used to execute JavaScript code and to e.g. perform an XSS attack. Grant permission to upload `.swf` files only if you understand and can accept this risk. ============================================================================== --> <defaultResourceTypes></defaultResourceTypes> <types> <type name="Files"> <url>%BASE_URL%files/</url> <directory>%BASE_DIR%files</directory> <maxSize>0</maxSize> <allowedExtensions>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,vsd,wav,wma,wmv,xls,xlsx,zip </allowedExtensions> <deniedExtensions></deniedExtensions> </type> <type name="Images"> <url>%BASE_URL%images/</url> <directory>%BASE_DIR%images</directory> <maxSize>0</maxSize> <allowedExtensions>bmp,gif,jpeg,jpg,png</allowedExtensions> <deniedExtensions></deniedExtensions> </type> <type name="Flash"> <url>%BASE_URL%flash/</url> <directory>%BASE_DIR%flash</directory> <maxSize>0</maxSize> <allowedExtensions>swf,flv</allowedExtensions> <deniedExtensions></deniedExtensions> </type> </types> <!-- The session variable name that CKFinder must use to retrieve the "role" of the current user. The "role", can be used in the "accessControls" settings (bellow). --> <userRoleSessionVar>CKFinder_UserRole</userRoleSessionVar> <accessControls> <accessControl> <role>*</role> <resourceType>*</resourceType> <folder>/</folder> <folderView>true</folderView> <folderCreate>true</folderCreate> <folderRename>true</folderRename> <folderDelete>true</folderDelete> <fileView>true</fileView> <fileUpload>true</fileUpload> <fileRename>true</fileRename> <fileDelete>true</fileDelete> </accessControl> </accessControls> <thumbs> <enabled>true</enabled> <url>%BASE_URL%_thumbs/</url> <directory>%BASE_DIR%_thumbs</directory> <directAccess>false</directAccess> <maxHeight>100</maxHeight> <maxWidth>100</maxWidth> <quality>80</quality> </thumbs> <!-- 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 web server. --> <disallowUnsafeCharacters>false</disallowUnsafeCharacters> <!-- Due to security issues with Apache modules, it is recommended to leave the following setting enabled. How does it work? Suppose the following: - If "php" is on the denied extensions list, a file named foo.php cannot be uploaded. - If "rar" (or any other) extension is allowed, one can upload a file named foo.rar. - The file foo.php.rar has "rar" extension so, in theory, it can be also uploaded. In some conditions Apache can treat the foo.php.rar file just like any PHP script and execute it. If CheckDoubleExtension is enabled, each part of the file name after a dot is checked, not only the last part. In this way, uploading foo.php.rar would be denied, because "php" is on the denied extensions list. --> <checkDoubleExtension>true</checkDoubleExtension> <!-- Indicates that the file size (maxSize) for images must be checked only after scaling them. Otherwise, it is checked right after uploading. --> <checkSizeAfterScaling>true</checkSizeAfterScaling> <!-- Perform additional checks for image files if set to true, validate image size --> <secureImageUploads>true</secureImageUploads> <!-- For security, HTML is allowed in the first Kb of data for files having the following extensions only. --> <htmlExtensions>html,htm,xml,js</htmlExtensions> <!-- Force ASCII names for files and folders. If enabled, characters with diactric marks will be automatically converted to ASCII letters. --> <forceASCII>false</forceASCII> <!-- Enables protection in the connector. The default CSRF protection mechanism is based on double submit cookies, where connector checks if the request contains a valid token that matches the token sent in the cookie https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet#Double_Submit_Cookies --> <enableCsrfProtection>true</enableCsrfProtection> <!-- Folders to not display in CKFinder, no matter their location. No paths are accepted, only the folder name. The * and ? wildcards are accepted. ".*" disallows the creation of folders starting with a dot character. --> <hideFolders> <folder>.*</folder> <folder>CVS</folder> </hideFolders> <!-- Files to not display/upload in CKFinder, no matter their location. No paths are accepted, only the file name, including extension. The * and ? wildcards are accepted. --> <hideFiles> <file>.*</file> </hideFiles> <plugins> <plugin> <name>imageresize</name> <class>com.ckfinder.connector.plugins.ImageResize</class> <params> <param name="smallThumb" value="90x90"></param> <param name="mediumThumb" value="120x120"></param> <param name="largeThumb" value="180x180"></param> </params> </plugin> <plugin> <name>fileeditor</name> <class>com.ckfinder.connector.plugins.FileEditor</class> <params></params> </plugin> <!-- Before enabling the watermark plugin make sure to specify path to source image --> <!-- The "internal" flag informs CKFinder that watermark is a pure server side plugin --> <!-- <plugin> <name>watermark</name> <class>com.ckfinder.connector.plugins.Watermark</class> <params> <param name="source" value="/path/in/servlet/context/logo.gif"></param> <param name="transparency" value="0.8"></param> <param name="quality" value="100"></param> <param name="marginRight" value="5"></param> <param name="marginBottom" value="5"></param> </params> <internal>true</internal> </plugin> --> </plugins> <basePathBuilderImpl>com.ckfinder.connector.configuration.ConfigurationPathBuilder</basePathBuilderImpl> </config> |
在web.xml中配置
|
<servlet> <servlet-name>ConnectorServlet</servlet-name> <servlet-class>com.ckfinder.connector.ConnectorServlet</servlet-class> <init-param> <description> Path to configuration file can be relative path inside application, absolute path on local file system or UNC path. </description> <param-name>XMLConfig</param-name> <param-value>/WEB-INF/config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>false</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ConnectorServlet</servlet-name> <url-pattern> /ckfinder/core/connector/java/connector.java </url-pattern> </servlet-mapping> |
ckeditor+ckfinder的更多相关文章
- jsp中如何整合CKEditor+CKFinder实现文件上传
最近笔者做了一个新闻发布平台,放弃了之前的FCKEditor编辑器,使用了CKEditor+CKFinder,虽然免费的CKFinder是Demo版本,但是功能完整,而且用户都是比较集中精神发新闻的人 ...
- 网络编辑器插件ckeditor+ckfinder配置
原帖地址 另外一个 去掉编辑器的下边栏 在config.js中加入: config.removePlugins = 'elementspath'; config.resize_enabled = fa ...
- 在ASP.NET项目中使用CKEditor +CKFinder实现图片上传功能
前言 之前的项目中一直使用的是FCKeditor,昨天突然有个想法:为什么不试一下新的CKEditor呢?于是花了大半天的时间去学习它的用法,现在把我的学习过程与大家分享一下. 谈起FCKeditor ...
- (配置)CKEditor+CKFinder+php上传配置,根据年月命名创建文件夹来存放
CKEditor+CKFinder+php上传配置 新版本的CKEditor只提供了基本的文本编辑功能,上传模块由另一个组件CKFinder.这里主要记录CKFinder上传的一些参数配置,能够成功上 ...
- CKEditor + CKFinder 实现编辑上传图片配置 (二)
CKEditor + CKFinder 实现编辑上传图片配置 (二) 上传图片时,如果上传的图片过大,默认情况情况下回自动裁剪,代码如图 \ckfinder\config.php 目录下的配置文件co ...
- CKEditor + CKFinder 实现编辑上传图片配置
下载最新版 ckfinder 本人下载的php版本 https://cksource.com/ckfinder/download 下载最新版ckeditor http://ckeditor.com/ ...
- .Net在线编辑器:KindEditor及CkEditor+CkFinder配置说明
Net在线编辑器:KindEditor及CkEditor+CkFinder配置说明 一.KindEditor(免费) KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所 ...
- CKEditor && CKFinder 配置
准备 ...
- MVC配置ckeditor+ckfinder
ckeditor当前使用版本:4.5.8 ckfinder当前使用版本:2.6.0 1.Ckeditor配置简单,直接使用Nuget下载就可 2.下载ckfinder https://cksource ...
- ASP.NET项目中使用CKEditor +CKFinder 实现上传图片
CKEditor是什么 CKEidtor是一个在线富文本编辑器,可以将让用户所见即所得的获得编辑在线文本,编辑器或自动将用户编辑的文字格式转换成html代码. 在ASP.NET工程中添加CKEdito ...
随机推荐
- Spring Cloud 之 服务注册与发现
作为微服务框架,提供服务注册发现是最基本的功能.Spring Cloud 针对服务注册发现 提供了 Eureka版本的实现 .Zookeeper版本的实现.Consul版本的实现.由于历史原因 Eur ...
- Qt无法正确 sendMessage 的消息
项目背景: 项目需要将vc中的代码移植到Qt中,而且由于使用的SDK是32位,所以,Qt使用的版本是MinGW32,另外下载的也是官网最新的版本Qt5.11.1. 系统环境:Windows10 在将w ...
- Beta 冲刺(7/7)
目录 摘要 团队部分 个人部分 摘要 队名:小白吃 组长博客:hjj 作业博客:beta冲刺(7/7) 后敬甲(组长) 过去两天完成了哪些任务 ppt制作 视频拍摄 接下来的计划 准备答辩 还剩下哪些 ...
- JUC--闭锁 CountDownLatch
CountDownLatch是一个同步辅助类,在完成一组正在其他线程中执行的操作之前,允许一个或者多个线程一直等待. 闭锁可以延迟线程的进度直到其到达终止状态,可以确保某些活动知道其他活动都完成才继续 ...
- Codeforces Round #352 (Div. 2) (A-D)
672A Summer Camp 题意: 1-n数字连成一个字符串, 给定n , 输出字符串的第n个字符.n 很小, 可以直接暴力. Code: #include <bits/stdc++.h& ...
- ABP学习之路--切换mysql数据库
1.添加mysql相关引用 注意,使用最新版本会导数据迁移时出错 2.修改链接字符串: <add name="Default" connectionString=" ...
- NOI2004郁闷的出纳员
传送门 题目看起来玄乎,但其实只需要一点点小 trick 就可以了. 我们可以用一个全局的 delta 来维护工资的调整记录 对于每一个新加入的员工,先判断是否低于最低工资下限,如果是,直接踢出,不做 ...
- 怎样解决if __name__ == "__main__":下面的代码没有执行的问题
很多初学者可能在用pycharm运行代码时会出现if __name__ == "__main__":下面的代码没有执行的问题,出现这类问题的原因是unittest运行姿势造成的,如 ...
- .Net 操作证书文件
一..Net加签与验签.经过测试,发现使用同一套私钥和公钥,JAVA和.Net可以实现互通 1.1 私钥加签 公钥验签 public void Encode() { try { var path = ...
- Linux支持ntfs,exfat格式文件系统
sudo apt-get install exfat-utilssudo apt-get install ntfs-3g ntfs-config exFAT最高支持16EB的文件,并且exfat在wi ...