+ -
当前位置:首页 → 问答吧 → fckeditor怎么上传图片?

fckeditor怎么上传图片?

时间:2010-07-04

来源:互联网

网上找了一下。太乱了

作者: 九剑   发布时间: 2010-07-04

帮你顶

作者: pgy251   发布时间: 2010-07-04

人气不行啊

作者: 九剑   发布时间: 2010-07-05

要整合FCK他们自己的一个文件上传程序,才能实现图片上传,或者花钱购买商业版的FCK(一般人不会这么做的吧?)

作者: taoli   发布时间: 2010-07-06

现在的fckeditor的上传图片功能已经屏蔽了,张老师讲的fckeditor视频课程里面那个版本的fckeditor可以上传图片,只需要配置下上传图片路径就行了

作者: zhoubin123   发布时间: 2010-07-06

能大体上说一下怎么配置路径吗?

作者: 983921847   发布时间: 2010-08-15

复制代码
  1. <?php
  2. /*
  3.  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4.  * Copyright (C) 2003-2008 Frederico Caldeira Knabben
  5.  *
  6.  * == BEGIN LICENSE ==
  7.  *
  8.  * Licensed under the terms of any of the following licenses at your
  9.  * choice:
  10.  *
  11.  *  - GNU General Public License Version 2 or later (the "GPL")
  12.  *    http://www.gnu.org/licenses/gpl.html
  13.  *
  14.  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15.  *    http://www.gnu.org/licenses/lgpl.html
  16.  *
  17.  *  - Mozilla Public License Version 1.1 or later (the "MPL")
  18.  *    http://www.mozilla.org/MPL/MPL-1.1.html
  19.  *
  20.  * == END LICENSE ==
  21.  *
  22.  * Configuration file for the File Manager Connector for PHP.
  23.  */
  24. global $Config ;
  25. // SECURITY: You must explicitly enable this "connector". (Set it to "true").
  26. // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
  27. //  authenticated users can access this file or use some kind of session checking.
  28. $Config['Enabled'] = true;   //默认为false;必需改为true
  29. // Path to user files relative to the document root.
  30. $Config['UserFilesPath'] = '/wuhan/uploads/uploadfile/' ; //wuhan 项目名称 uploads 一级目录 uploadfile 存放图片的二级目录
  31. // Fill the following value it you prefer to specify the absolute path for the
  32. // user files directory. Useful if you are using a virtual directory, symbolic
  33. // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  34. // Attention: The above 'UserFilesPath' must point to the same directory.
  35. $Config['UserFilesAbsolutePath'] = '' ;
  36. // Due to security issues with Apache modules, it is recommended to leave the
  37. // following setting enabled.
  38. $Config['ForceSingleExtension'] = true ;
  39. // Perform additional checks for image files.
  40. // If set to true, validate image size (using getimagesize).
  41. $Config['SecureImageUploads'] = true;
  42. // What the user can do with this connector.
  43. $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ;
  44. // Allowed Resource Types.
  45. $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ;
  46. // For security, HTML is allowed in the first Kb of data for files having the
  47. // following extensions only.
  48. $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ;
  49. // After file is uploaded, sometimes it is required to change its permissions
  50. // so that it was possible to access it at the later time.
  51. // If possible, it is recommended to set more restrictive permissions, like 0755.
  52. // Set to 0 to disable this feature.
  53. // Note: not needed on Windows-based servers.
  54. $Config['ChmodOnUpload'] = 0777 ;
  55. // See comments above.
  56. // Used when creating folders that does not exist.
  57. $Config['ChmodOnFolderCreate'] = 0777 ;
  58. /*
  59.  Configuration settings for each Resource Type
  60.  - AllowedExtensions: the possible extensions that can be allowed.
  61.   If it is empty then any file type can be uploaded.
  62.  - DeniedExtensions: The extensions that won't be allowed.
  63.   If it is empty then no restrictions are done here.
  64.  For a file to be uploaded it has to fulfill both the AllowedExtensions
  65.  and DeniedExtensions (that's it: not being denied) conditions.
  66.  - FileTypesPath: the virtual folder relative to the document root where
  67.   these resources will be located.
  68.   Attention: It must start and end with a slash: '/'
  69.  - FileTypesAbsolutePath: the physical path to the above folder. It must be
  70.   an absolute path.
  71.   If it's an empty string then it will be autocalculated.
  72.   Useful if you are using a virtual directory, symbolic link or alias.
  73.   Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  74.   Attention: The above 'FileTypesPath' must point to the same directory.
  75.   Attention: It must end with a slash: '/'
  76.   - QuickUploadPath: the virtual folder relative to the document root where
  77.   these resources will be uploaded using the Upload tab in the resources
  78.   dialogs.
  79.   Attention: It must start and end with a slash: '/'
  80.   - QuickUploadAbsolutePath: the physical path to the above folder. It must be
  81.   an absolute path.
  82.   If it's an empty string then it will be autocalculated.
  83.   Useful if you are using a virtual directory, symbolic link or alias.
  84.   Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
  85.   Attention: The above 'QuickUploadPath' must point to the same directory.
  86.   Attention: It must end with a slash: '/'
  87.    NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to
  88.    "userfiles" directory to maintain backwards compatibility with older versions of FCKeditor.
  89.    This is fine, but you in some cases you will be not able to browse uploaded files using file browser.
  90.    Example: if you click on "image button", select "Upload" tab and send image
  91.    to the server, image will appear in FCKeditor correctly, but because it is placed
  92.    directly in /userfiles/ directory, you'll be not able to see it in built-in file browser.
  93.    The more expected behaviour would be to send images directly to "image" subfolder.
  94.    To achieve that, simply change
  95.    $Config['QuickUploadPath']['Image']   = $Config['UserFilesPath'] ;
  96.    $Config['QuickUploadAbsolutePath']['Image'] = $Config['UserFilesAbsolutePath'] ;
  97.   into:
  98.    $Config['QuickUploadPath']['Image']   = $Config['FileTypesPath']['Image'] ;
  99.    $Config['QuickUploadAbsolutePath']['Image']  = $Config['FileTypesAbsolutePath']['Image'] ;
  100. */
  101. $Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ;
  102. $Config['DeniedExtensions']['File']  = array() ;
  103. $Config['FileTypesPath']['File']  = $Config['UserFilesPath'] . 'file/' ;
  104. $Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
  105. $Config['QuickUploadPath']['File']  = $Config['UserFilesPath'] ;
  106. $Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;
  107. $Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png') ;
  108. $Config['DeniedExtensions']['Image'] = array() ;
  109. $Config['FileTypesPath']['Image']  = $Config['UserFilesPath'] . 'image/' ;
  110. $Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
  111. $Config['QuickUploadPath']['Image']  = $Config['UserFilesPath'] ;
  112. $Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;
  113. $Config['AllowedExtensions']['Flash'] = array('swf','flv') ;
  114. $Config['DeniedExtensions']['Flash'] = array() ;
  115. $Config['FileTypesPath']['Flash']  = $Config['UserFilesPath'] . 'flash/' ;
  116. $Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
  117. $Config['QuickUploadPath']['Flash']  = $Config['UserFilesPath'] ;
  118. $Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;
  119. $Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ;
  120. $Config['DeniedExtensions']['Media'] = array() ;
  121. $Config['FileTypesPath']['Media']  = $Config['UserFilesPath'] . 'media/' ;
  122. $Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
  123. $Config['QuickUploadPath']['Media']  = $Config['UserFilesPath'] ;
  124. $Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;
  125. ?>

作者: zhoubin123   发布时间: 2010-08-15