用的是PHP 1.4.3版本,修改了config.json文件下的imageUrlPrefix和imagePathFormat两个配置项,好像不起作用啊,要修改哪里才能上传到指定位置?求教

解决方案 »

  1.   

    你的后端php文件才能决定图片上传的路径。    /**
         * 富文本图片上传
         * */
        public function imageUploadUeditor()
        {
            include dirname(dirname(dirname(__DIR__)))."/vendor/umeditor/php/Uploader.class.php";        //上传文件目录
            $Path = dirname(dirname(dirname(__DIR__)))."/Public/Common/img/article";        //上传配置
            $config = array(
                "savePath" => $Path,             //存储文件夹
                "maxSize" => 1000 ,              //允许的文件最大尺寸,单位KB
                "allowFiles" => array(".gif",".png",".jpg",".jpeg",".bmp")  //允许的文件格式
            );        //背景保存在临时目录中
            $up = new \Uploader( "upfile" , $config );
            $info = $up->getFileInfo();        //处理url字段
            $info["url"] = str_replace("/data/wwwroot/default/Public/Common/img","",$info["url"]);
            echo json_encode($info);
            exit();
        }