CKfinder文件上传,不同用户不同文件夹
官网地址:https://ckeditor.com/ckfinder/
- 把ckfinder文件夹放入项目中
- 指向文件夹中的本地ckfinder.js
- 打开authentication
$config['authentication'] = function () { return true; };
4.如果实现一个用户一个文件夹,打开注释中的root, 用户名对应用户文件夹
$config['backends'][] = array( 'name' => 'default', 'adapter' => 'local', 'baseUrl' => '/ckfinder/userfiles/', // 'root' => '', // Can be used to explicitly set the CKFinder user files directory. 'chmodFiles' => 0777, 'chmodFolders' => 0755, 'filesystemEncoding' => 'UTF-8', );
$user = 'local'; $userfiles = '/upload/ckfinder/userfiles/'; session_start(); if (isset($_SESSION["SellerId"]) && !empty($_SESSION["SellerId"])) { $user = $_SESSION["SellerId"]; $userfiles = '/upload/ckfinder'.'/'.$_SESSION["SellerId"].'/'; } $config['backends'][] = array( 'name' => 'default', 'adapter' => 'local', 'baseUrl' => $userfiles, // 'root' => '', // Can be used to explicitly set the CKFinder user files directory. 'chmodFiles' => 0777, 'chmodFolders' => 0755, 'filesystemEncoding' => 'UTF-8', $user => $userfiles, );

浙公网安备 33010602011771号