首页 > 代码库 > UEditor1.4.3上传图片提示上传失败

UEditor1.4.3上传图片提示上传失败

通过UEditor1.4.3上传图片附件时,提示上传错误。发现JS报错如下图:

UEditor的asp目录下controller.asp?action=uploadimage文件报500错误。

技术分享

打开页面,具体错误内容为:

ADODB.Stream 错误 ‘800a0bb9‘

参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

/ueditor/asp/MultiformProcessor.class.asp,行 73

解决办法:

打开文件ueditor\asp\Uploader.Class.asp,找到大概203行处。

改前:

 

Private Function CheckOrCreatePath( ByVal path )
        Set fs = Server.CreateObject("Scripting.FileSystemObject")
        Dim parts
        parts = Split( path, "\" )
        path = ""
        For Each part in parts
            path = path + part + "\"
            If fs.FolderExists( path ) = False Then
                fs.CreateFolder( path )
            End If
        Next
    End Function

 

改后:

Private Function CheckOrCreatePath( ByVal path )
    Set fs = Server.CreateObject("Scripting.FileSystemObject")
    Dim parts
        Dim root : root = Server.mappath("/") & "\"
    parts = Split( path, "\" )
        parts = Split( Replace(path, root, ""), "\" )
    path = ""
        path = root
    For Each part in parts
      path = path + part + "\"
      If fs.FolderExists( path ) = False Then
        fs.CreateFolder( path )
      End If
    Next
  End Function

其它解决方法:

文件夹asp中有个文件uploader.class.asp,其中有个检查或创建路径的子程序Private Function CheckOrCreatePath( ByVal path ),在这段程序中有两句 parts = Split( path, "\" )和path = path + part + "\",你把这两句中的反斜杠都改成“/”,也就是这两句最后应当分别是parts = Split( path, "/" )和path = path + part + "/",这样就可以了。

UEditor其它相关问题:

http://www.cnblogs.com/cdxkyz/p/4007782.html

 

UEditor1.4.3上传图片提示上传失败