百度UEditor编辑器在网站的后台使用越来越多,但很多第一次接触它的技术员在本地服务器上测试好后上传到服务器上却提示上传错误:
解决办法:
打开ueditor/asp/Uploader.class.asp文件,找到: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( 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
修改后测试上传图片功能已恢复正常: