|
|
|
CKFinder - ไม่สามารถ กด Browse Server ได้ แต่สามารถอัพโหลดรูปภาพได้ตามปกติ folder ตำแหน่งที่อัพโหลดถูกต้อง |
|
|
|
|
|
|
|
ตามในภาพ , คือเมื่อกด Browse Server บน CKEditor ไม่สามารถเข้าไปในหน้า CKFinder ได้, ลองเปลี่ยนทั้ง CKEditor V3-4 แล้ว ไม่มีผลเลยครับ, CKfinder ใช้ V.3.4.3 (ตัวล่าสุด)
ฟังก์ชั่นอื่นๆบน CKEditor ใช้งานได้ปกติ รวมถึง ปุ่มอัพโหลดภาพ ก็ยังอัพไปยังตำแหน่งที่ระบุไว้ ได้ปกติ , ลองค้นหาบน google, stackoverflow และเว็บอื่นๆแล้ว มีคนเป็น error แบบเดียวกัน 2-3 คน แต่ไม่มีคนตอบเลยน่ะครับ เลยไม่รู้ทางแก้ไข
ช่วยหน่อยนะครับ
ส่วนนี่เป็น CKFinder config file นะครับ
Code (PHP)
<?php
/*
* CKFinder Configuration File
*
* For the official documentation visit https://docs.ckeditor.com/ckfinder/ckfinder3-php/
*/
/*============================ PHP Error Reporting ====================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/debugging.html
// Production
//error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
//ini_set('display_errors', 0);
// Development
error_reporting(E_ALL);
ini_set('display_errors', 1);
/*============================ General Settings =======================================*/
//
$config = array();
$config['csrfProtection'] = false;
/*============================ Enable PHP Connector HERE ==============================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_authentication
$config['authentication'] = function () {
return true;
};
/*============================ License Key ============================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_licenseKey
$config['licenseName'] = '';
$config['licenseKey'] = '';
/*============================ CKFinder Internal Directory ============================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_privateDir
$config['privateDir'] = array(
'backend' => 'default',
'tags' => '.ckfinder/tags',
'logs' => '.ckfinder/logs',
'cache' => '.ckfinder/cache',
'thumbs' => '.ckfinder/cache/thumbs',
);
/*============================ Images and Thumbnails ==================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_images
$config['images'] = array(
'maxWidth' => 1600,
'maxHeight' => 1200,
'quality' => 80,
'sizes' => array(
'small' => array('width' => 480, 'height' => 320, 'quality' => 80),
'medium' => array('width' => 600, 'height' => 480, 'quality' => 80),
'large' => array('width' => 800, 'height' => 600, 'quality' => 80)
)
);
$config['thumbnails'] = array(
'enabled' => true,
'sizes' => array(
array('width' => '150', 'height' => '150', 'quality' => 80),
array('width' => '300', 'height' => '300', 'quality' => 80),
array('width' => '500', 'height' => '500', 'quality' => 80),
),
'bmpSupported' => true,
);
/*=================================== Backends ========================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_backends
$path = "/payforucms";
$baseUrl = "http://$_SERVER[HTTP_HOST]".$path."/upload/userfile/";
$baseDir = __DIR__.'/../../upload/userfile/';
$config['backends'][] = array(
'name' => 'default',
'adapter' => 'local',
'baseUrl' => $baseUrl, //'/ckfinder/userfiles/',
'root' => $baseDir, // Can be used to explicitly set the CKFinder user files directory.
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8',
);
/*================================ Resource Types =====================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_resourceTypes
$config['defaultResourceTypes'] = '';
$config['resourceTypes'][] = array(
'name' => $baseUrl . 'files', // Single quotes not allowed.
'directory' => $baseDir . 'files',
'maxSize' => 0,
'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',
'deniedExtensions' => '',
'backend' => 'default'
);
$config['resourceTypes'][] = array(
'name' => 'Images',
'directory' => 'images',
'maxSize' => 0,
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
'deniedExtensions' => '',
'backend' => 'default'
);
/*================================ Access Control =====================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_roleSessionVar
$config['roleSessionVar'] = 'CKFinder_UserRole';
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_accessControl
$config['accessControl'][] = array(
'role' => '*',
'resourceType' => '*',
'folder' => '/',
'FOLDER_VIEW' => true,
'FOLDER_CREATE' => true,
'FOLDER_RENAME' => true,
'FOLDER_DELETE' => true,
'FILE_VIEW' => true,
'FILE_CREATE' => true,
'FILE_RENAME' => true,
'FILE_DELETE' => true,
'IMAGE_RESIZE' => true,
'IMAGE_RESIZE_CUSTOM' => true
);
/*================================ Other Settings =====================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html
$config['overwriteOnUpload'] = false;
$config['checkDoubleExtension'] = true;
$config['disallowUnsafeCharacters'] = false;
$config['secureImageUploads'] = true;
$config['checkSizeAfterScaling'] = true;
$config['htmlExtensions'] = array('html', 'htm', 'xml', 'js');
$config['hideFolders'] = array('.*', 'CVS', '__thumbs');
$config['hideFiles'] = array('.*');
$config['forceAscii'] = false;
$config['xSendfile'] = false;
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_debug
$config['debug'] = true;
/*==================================== Plugins ========================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_plugins
$config['pluginsDirectory'] = __DIR__ . '/plugins';
$config['plugins'] = array();
/*================================ Cache settings =====================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_cache
$config['cache'] = array(
'imagePreview' => 24 * 3600,
'thumbnails' => 24 * 3600 * 365,
'proxyCommand' => 0
);
/*============================ Temp Directory settings ================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_tempDirectory
$config['tempDirectory'] = sys_get_temp_dir();
/*============================ Session Cause Performance Issues =======================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_sessionWriteClose
$config['sessionWriteClose'] = true;
/*================================= CSRF protection ===================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_csrfProtection
$config['csrfProtection'] = false;
/*===================================== Headers =======================================*/
// https://docs.ckeditor.com/ckfinder/ckfinder3-php/configuration.html#configuration_options_headers
$config['headers'] = array();
/*============================== End of Configuration =================================*/
// Config must be returned - do not change it.
return $config;
Tag : PHP, MySQL, HTML, Ajax, XAMPP, Windows
|
ประวัติการแก้ไข 2018-06-21 18:45:15 2018-06-21 18:47:53
|
|
|
|
|
Date :
2018-06-21 18:43:35 |
By :
copsychus |
View :
1671 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|