ueditor编辑器asp版不能上传图片的解决方法(800a0046)

第一步,先去IIS 中,打开ASP 设置页面,把错误信息发送到浏览器,有助于找到问题。


使用百度开源ueditor编辑器不能上传图片并报服务器500错误

初看是 Uploader.Class 的 fs.CreateFolder( path ) 这条语句不能创建目录,怀疑权限问题,提供所有权限后,依然不行。

最后参考百度官方文档将该代码内函数

    Private Function CheckOrCreatePath( ByVal path )
        Set fs = Server.CreateObject("Scripting.FileSystemObject")
        Dim parts
        parts = Split( 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( Replace(path, root, ""), "\" )
        path = root
        For Each part in parts
            path = path + part + "\"
            If fs.FolderExists( path ) = False Then
                fs.CreateFolder( path )
            End If
        Next
    End Function


即可正常上传。


猜你喜欢

转载自blog.csdn.net/ybb350680013/article/details/51469372
今日推荐