一,先找到\ueditor\php这个文件夹,找到config.json,配置里面的图片路径,75行左右 如果图片路径是按时间归类的.还里设置好后.还需要在php文件中进行替换
"imageManagerActionName": "listimage",
"imageManagerListPath": "/Uploads/Editor/Picture/{yyyy}-{mm}-{dd}/",
"imageManagerListSize": 20,
"imageManagerUrlPrefix": "",
"imageManagerInsertAlign": "none",
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
二,找到\ueditor\php/action_list.php 这个文件.修改 40行左右这里的路径要正确
$rootpath = str_replace('/Public/admin/ueditor/php/action_list.php', '', str_replace('\\', '/', __FILE__));
三,这个文件中要增加测试文件.查看打印出来的路径是多少,类似下面的打印结果.根本情况修改.或直接写死了,比如你可以直接定义$path =“D:/phpstudy_pro/WWW/Uploads/Editor/Picture/”;这样
file_put_contents('1.txt',$path);
file_put_contents('333.txt',$path);
$path = $_SERVER['DOCUMENT_ROOT'].'/'. (substr($path, 0, 1) == "/" ? "":"/") . $path;
$t = time();
$d = explode('-', date("Y-m-d-H-i-s"));
$path = str_replace("{yyyy}", $d[0], $path);
$path = str_replace("{mm}", $d[1], $path);
$path = str_replace("{dd}", $d[2], $path);
$path = str_replace("//", "/", $path);
file_put_contents('3.txt',$path);
最终效果
|