FCKeditor上传图片错误解决办法

DATE: 2016-11-10 / VIEWS: 939

FCKeditor上传图片出现错误“The server didn't send back a proper XML response. Please contact your system administrator”,基本上分为三大原因(我这里只提供ASP相关方法):

一、目录权限、路径错误和是否含有中文名称
这点比较容易检查,首先查看编辑器设置上传路径是否正确、文件夹是否存在,文件夹权限是否开放,还有查看文件夹里的文件名称有没有包含中文(FCKeditor某个版本含中文名称会出现错误);

二、系统是否支持XMLHttp或有没有安装msxml
看下FCKeditor\editor\filemanager\browser\default\js\fckxml.js文件,其中

  1. if ( ( oXmlHttp.status != 200 && oXmlHttp.status != 304 ) || oXmlHttp.responseXML == null || oXmlHttp.responseXML.firstChild == null )  
  2.                 {  
  3.                     alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' +  
  4.                             'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +  
  5.                             'Requested URL:\n' + urlToCall + '\n\n' +  
  6.                             'Response text:\n' + oXmlHttp.responseText ) ;  
  7.                     return ;  
  8.                 }  

这是错误提示的代码,在这里我们可以很清楚的看到问题出现在的原因:
oXmlHttp.status != 200 && oXmlHttp.status != 304
这说明XMLHttpRequest的请求不成功,所以要看系统是否支持XMLHttp或有没有安装msxml;
oXmlHttp.responseXML == null || oXmlHttp.responseXML.firstChild == null
这说明XMLHttp请求是否有返回值,所以要看请求的路径和参数是否正确。

三、服务器支持不支持Scripting.FileSystemObject组件
Scripting.FileSystemObject,简称:FSO (文件系统管理、文本文件读写)
FCKeditor\editor\filemanager\browser\default\connectors\asp\commands.asp
FCKeditor\editor\filemanager\browser\default\connectors\asp\io.asp
两个文件中都用到了FSO组件。
如果不支持,请联系管理员安装此组件;否则换编辑器或换服务器。