ueditor 禁止编辑_UEditor 编辑器常见问题解决

ueditor单图上传图片显示上传错误/多图上传显示服务器错误,实际上图片已经传到服务器或者本地

1、这个问题是因为ueditor里面的Upload.class.php里面__construct()方法里面的iconv函数有问题

/*$this->stateMap['ERROR_TYPE_NOT_ALLOWED'] = iconv('unicode', 'utf-8', $this->stateMap['ERROR_TYPE_NOT_ALLOWED']);*/

$this->stateMap['ERROR_TYPE_NOT_ALLOWED'] = mb_convert_encoding($this->stateMap['ERROR_TYPE_NOT_ALLOWED'], 'utf-8', 'auto');

2、config.json 文件配置: imageUrlPrefix ,一般配置访问域名

请求后台http 配置错误,上传功能不能正常使用

1、ueditor.config.js

//var URL = window.UEDITOR_HOME_URL || getUEBasePath();

var URL =window.location.protocol+"//"+window.location.host; //协议+域名,这里是80默认端口,如果是其他建议加上端口号

//为编辑器实例添加一个路径,这个不能被注释

UEDITOR_HOME_URL: '/ueditor/',//静态文件路径

//服务器统一请求接口路径

serverUrl: URL + "/plugin/EditorUpfile/requestUp",

2、config.json

*UrlPrefix=协议+域名+端口号 //如果是80,可以不写

*PathFormat=> "/ueditor/upload/image/{yyyy}{mm}/{time}{rand:6}", /*相对于域名上传保存路径,可以自定义保存路径和文件名格式*/

后端配置项没有正常加载,上传插件不能正常使用!

可以测试一下 php 代码是否正确执行,在浏览器打开 ueditor/controller.php 对应的路径,看看是有配置值返回(json 格式)

{"imageActionName":"uploadimage","imageFieldName":"upfile","imageMaxSize":10485760,"imageAllowFiles":[".jpeg",".jpg",".png",".gif"],"imageCompressEnable":true,"imageCompressBorder":1600,"imageInsertAlign":"none","imageUrlPrefix":"http:\/\/tp.com\/","imagePathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","scrawlActionName":"uploadscrawl","scrawlFieldName":"upfile","scrawlPathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","scrawlMaxSize":2048000,"scrawlUrlPrefix":"","scrawlInsertAlign":"none","snapscreenActionName":"uploadimage","snapscreenPathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","snapscreenUrlPrefix":"","snapscreenInsertAlign":"none","catcherLocalDomain":["127.0.0.1","localhost","img.baidu.com"],"catcherActionName":"catchimage","catcherFieldName":"source","catcherPathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","catcherUrlPrefix":"","catcherMaxSize":2048000,"catcherAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"videoActionName":"uploadvideo","videoFieldName":"upfile","videoPathFormat":"\/ueditor\/upload\/video\/{yyyy}{mm}\/{time}{rand:6}","videoUrlPrefix":"","videoMaxSize":104857600,"videoAllowFiles":[".avi",".mov",".wav",".mp4",".mp3"],"fileActionName":"uploadfile","fileFieldName":"upfile","filePathFormat":"\/ueditor\/upload\/file\/{yyyy}{mm}\/{time}{rand:6}","fileUrlPrefix":"http:\/\/tp.com","fileMaxSize":52428800,"fileAllowFiles":[".txt",".doc",". docx",". xls",". xlsx",". ppt",".htm",".html",".zip",".rar",".gz",".bz2",".pdf"],"imageManagerActionName":"listimage","imageManagerListPath":"\/ueditor\/upload\/image\/","imageManagerListSize":20,"imageManagerUrlPrefix":"","imageManagerInsertAlign":"none","imageManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"fileManagerActionName":"listfile","fileManagerListPath":"\/ueditor\/upload\/file\/","fileManagerUrlPrefix":"","fileManagerListSize":20,"fileManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid",".rar",".zip",".tar",".gz",".7z",".bz2",".cab",".iso",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf",".txt",".md",".xml"]}

View Code

你可能感兴趣的:(ueditor,禁止编辑)