ckeditor加入elfinder檔案上傳功能

參考實戰php7+mysql從0開始寫出自己想要寫的程式(吳弘凱,松崗)P15-14
■修改ckeditor/config.js
在最下方的}之前加入
config.filebrowserBrowseUrl='../js/elFinder/elfinder.html';

■修改elFinder/elfinder.html
直接從光碟複製過來

■在include/config.php中定義
//上傳檔案路徑

define('_UPLOAD_PATH' ,'/var/www/html/sport10901/upload/');
define('_UPLOAD_URL' ,'http://163.26.179.2/sport10901/upload/');

■修改elFinder/php/connector.minimal.php
先在開頭引入
include_once "../../../include/config.php";
修改

//'uploadDeny'    => array('all'),
'uploadDeny' => ['text/php', 'text/x-php', 'application/php', 'application/x-php', 'application/x-httpd-php', 'application/x-httpd-php-source'],

//'uploadAllow'   => array('image', 'text/plain'),
'uploadAllow' => ['all'],

//'uploadOrder'   => array('deny', 'allow'), 
'uploadOrder' => ['allow', 'deny'],


 

註:出現「elfinder無可讀取的磁碟」是因為_UPLOAD_PATH or _UPLOAD_URL 引入錯誤
elFinder/php/connector.minimal.php開頭未正確引入include_once "../../../include/config.php";

本篇發表於 程式設計。將永久鏈結加入書籤。