请求后台配置项http错误,上传功能将不能正常使用!
我的config.json中的相关文件是这样的:
/* 前后端通信相关的配置,注释只允许使用多行方式 */
{
/* 上传图片配置项 */
"imageActionName": "uploadimage", /* 执行上传图片的action名称 */
"imageFieldName": "upfile", /* 提交的图片表单名称 */
"imageMaxSize": 2048000, /* 上传大小限制,单位B */
"imageAllowFiles": [ ".png", ".jpg", ".jpeg", ".gif", ".bmp" ], /* 上传图片格式显示 */
"imageCompressEnable": true, /* 是否压缩图片,默认是true */
"imageCompressBorder": 1600, /* 图片压缩最长边限制 */
"imageInsertAlign": "none", /* 插入的图片浮动方式 */
"imageUrlPrefix": "/", /* 图片访问路径前缀 */
"imagePathFormat ": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
/* {time} 会替换成时间戳 */
/* {yyyy} 会替换成四位年份 */
/* {yy} 会替换成两位年份 */
/* {mm} 会替换成两位月份 */
/* {dd} 会替换成两位日期 */
/* {hh} 会替换成两位小时 */
/* {ii} 会替换成两位分钟 */
/* {ss} 会替换成两位秒 */
/* 非法字符 \ : * ? " < > | */
umeditor.config.js里是这样的:
var URL = window.UMEDITOR_HOME_URL || (function(){
function PathStack() {
debugger;
this.documentURL = self.document.URL || self.location.href;
this.separator = '/';
this.separatorPattern = /\\|\//g;
this.currentDir = './';
this.currentDirPattern = /^[.]\/]/;
this.path = this.documentURL;
this.stack = [];
this.push( this.documentURL );
}
PathStack.isParentPath = function( path ){
return path === '..';
};
PathStack.hasProtocol = function( path ){
return !!PathStack.getProtocol( path );
};
PathStack.getProtocol = function( path ){
var protocol = /^[^:]*:\/*/.exec( path );
return protocol ? protocol[0] : null;
};
PathStack.prototype = {
push: function( path ){
this.path = path;
update.call( this );
parse.call( this );
return this;
},
getPath: function(){
return this + "";
},
toString: function(){
return this.protocol + ( this.stack.concat( [''] ) ).join( this.separator );
}
};
function update() {
var protocol = PathStack.getProtocol( this.path || '' );
if( protocol ) {
//根协议
this.protocol = protocol;
//local
this.localSeparator = /\\|\//.exec( this.path.replace( protocol, '' ) )[0];
this.stack = [];
} else {
protocol = /\\|\//.exec( this.path );
protocol && (this.localSeparator = protocol[0]);
}
}
function parse(){
var parsedStack = this.path.replace( this.currentDirPattern, '' );
if( PathStack.hasProtocol( this.path ) ) {
parsedStack = parsedStack.replace( this.protocol , '');
}
parsedStack = parsedStack.split( this.localSeparator );
parsedStack.length = parsedStack.length - 1;
for(var i= 0,tempPath,l=parsedStack.length,root = this.stack;i<l;i++){
tempPath = parsedStack[i];
if(tempPath){
if( PathStack.isParentPath( tempPath ) ) {
root.pop();
} else {
root.push( tempPath );
}
}
}
}
var currentPath = document.getElementsByTagName('script');
currentPath = currentPath[ currentPath.length -1 ].src;
return new PathStack().push( currentPath ) + "";
})();
/**
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
*/
window.UMEDITOR_CONFIG = {
//为编辑器实例添加一个路径,这个不能被注释
UMEDITOR_HOME_URL : URL
//图片上传配置区
, imageUrl: URL + "/wwwroot/Files/Pictures" //图片上传提交地址
, imagePath: URL + "src/Pictures" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
,imageFieldName:"upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
拜托帮帮忙,谢谢各位!