您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > PHP >

CKEditor图片上传功能开启方法(2)

来源:未知 责任编辑:责任编辑 发表时间:2015-09-09 15:34 点击:

File Browser  Window Size The default width of file browser window in CKEditor is set to 80%  of screen width, the default hight is set to 70% of screen height. If for some  reasons, the default values are not suitable for you, you can change it to any  other value.

Use filebrowserWindowWidth to change width and  filebrowserWindowHeight to change height of the window.

To set the size  of the window in pixels, just set the number value (e.g. "800"). If you prefer  to set height and width of the window in percentage of the screen, remember to  add percent sign at the end (e.g. "60%").

Example 3 
CKEDITOR.replace( 'editor1', {
filebrowserBrowseUrl :  '/browser/browse.php',
filebrowserUploadUrl :  '/uploader/upload.php',
filebrowserWindowWidth :  '640',
filebrowserWindowHeight : '480',
});
To set the window size of  file browser inside of a specific dialog box, use  filebrowser[dialogName]WindowWidth and filebrowser[dialogName]WindowHeight  settings.

For example, to change the file browser window size only in  "Image" dialog box, change set the filebrowserImageWindowWidth and  filebrowserImageWindowHeight settings.

Example 4
CKEDITOR.replace(  'editor1', {
filebrowserBrowseUrl :  '/browser/browse.php',
filebrowserUploadUrl :  '/uploader/upload.php',
filebrowserImageWindowWidth :  '640',
filebrowserImageWindowHeight : '480',
});

Using  CKFinder
CKFinder may be easily integrated with CKEditor (see live demo). 

The integration may be done in two ways: by setting CKEditor  configuration options (example below) or using the CKFinder.SetupCKEditor()  method available in CKFinder API.

Example 5
CKEDITOR.replace(  'editor1',
{
filebrowserBrowseUrl :  '/ckfinder/ckfinder.html',
filebrowserImageBrowseUrl :  '/ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl :  '/ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl :  '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl  :  '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl  :  '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
});
The  example above is valid for PHP environment. /ckfinder/ is a base path to the  CKFinder installation directory. If your using CKFinder for ASP, ASP.NET or  ColdFusion remember to change "php" to the right extension:

asp  - CKFinder for ASP
aspx – CKFinder for ASP.NET
cfm – CKFinder for  ColdFusion
php – CKFinder for PHP

发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • PHP测试
  • 十天学会php之第六天
  • 查找数组中指定键名的值
  • 几种显示数据的方法的比较
  • 使用xmlhttp为网站增加域名查询功能
  • PHP+MYSQL+Javascript数据库查询结果的动态显示
  • 用redis实现跨服务器session
  • 用新浪微博接口发送图片微博失败的原因
  • smarty局部缓存技术[源码分析]
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1