Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/class_upload.asp
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/class_upload.asp	(revision 353)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/class_upload.asp	(revision 354)
@@ -1,32 +1,32 @@
-﻿<%
- ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
- ' Copyright (C) 2003-2007 Frederico Caldeira Knabben
- '
- ' == BEGIN LICENSE ==
- '
- ' Licensed under the terms of any of the following licenses at your
- ' choice:
- '
- '  - GNU General Public License Version 2 or later (the "GPL")
- '    http://www.gnu.org/licenses/gpl.html
- '
- '  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
- '    http://www.gnu.org/licenses/lgpl.html
- '
- '  - Mozilla Public License Version 1.1 or later (the "MPL")
- '    http://www.mozilla.org/MPL/MPL-1.1.html
- '
- ' == END LICENSE ==
- '
- ' These are the classes used to handle ASP upload without using third
- ' part components (OCX/DLL).
-%>
+﻿<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * These are the classes used to handle ASP upload without using third
+ * part components (OCX/DLL).
+-->
 <%
 '**********************************************
 ' File:		NetRube_Upload.asp
-' Version:	NetRube Upload Class Version 2.1 Build 20050228
+' Version:	NetRube Upload Class Version 2.3 Build 20070528
 ' Author:	NetRube
 ' Email:	NetRube@126.com
-' Date:		02/28/2005
+' Date:		05/28/2007
 ' Comments:	The code for the Upload.
 '			This can free usage, but please
@@ -36,8 +36,8 @@
 '**********************************************
 ' 文件名:	NetRube_Upload.asp
-' 版本:		NetRube Upload Class Version 2.1 Build 20050228
+' 版本:		NetRube Upload Class Version 2.3 Build 20070528
 ' 作者:		NetRube(网络乡巴佬)
 ' 电子邮件:	NetRube@126.com
-' 日期:		2005年02月28日
+' 日期:		2007年05月28日
 ' 声明:		文件上传类
 '			本上传类可以自由使用，但请保留此版权声明信息
@@ -51,14 +51,14 @@
 	Private oSourceData
 	Private nMaxSize, nErr, sAllowed, sDenied
-
+	
 	Private Sub Class_Initialize
 		nErr		= 0
 		nMaxSize	= 1048576
-
+		
 		Set File			= Server.CreateObject("Scripting.Dictionary")
 		File.CompareMode	= 1
 		Set Form			= Server.CreateObject("Scripting.Dictionary")
 		Form.CompareMode	= 1
-
+		
 		Set oSourceData		= Server.CreateObject("ADODB.Stream")
 		oSourceData.Type	= 1
@@ -66,5 +66,5 @@
 		oSourceData.Open
 	End Sub
-
+	
 	Private Sub Class_Terminate
 		Form.RemoveAll
@@ -72,11 +72,11 @@
 		File.RemoveAll
 		Set File = Nothing
-
+		
 		oSourceData.Close
 		Set oSourceData = Nothing
 	End Sub
-
+	
 	Public Property Get Version
-		Version = "NetRube Upload Class Version 1.0 Build 20041218"
+		Version = "NetRube Upload Class Version 2.3 Build 20070528"
 	End Property
 
@@ -84,13 +84,13 @@
 		ErrNum	= nErr
 	End Property
-
+	
 	Public Property Let MaxSize(nSize)
 		nMaxSize	= nSize
 	End Property
-
+	
 	Public Property Let Allowed(sExt)
 		sAllowed	= sExt
 	End Property
-
+	
 	Public Property Let Denied(sExt)
 		sDenied	= sExt
@@ -104,5 +104,5 @@
 			Exit Sub
 		End If
-
+		
 		Dim nTotalSize
 		nTotalSize	= Request.TotalBytes
@@ -115,10 +115,33 @@
 			Exit Sub
 		End If
-
-		oSourceData.Write Request.BinaryRead(nTotalSize)
+		
+		'Thankful long(yrl031715@163.com)
+		'Fix upload large file.
+		'**********************************************
+		' 修正作者：long
+		' 联系邮件: yrl031715@163.com
+		' 修正时间：2007年5月6日
+		' 修正说明：由于iis6的Content-Length 头信息中包含的请求长度超过了 AspMaxRequestEntityAllowed 的值（默认200K）, IIS 将返回一个 403 错误信息.
+		'          直接导致在iis6下调试FCKeditor上传功能时，一旦文件超过200K,上传文件时文件管理器失去响应，受此影响，文件的快速上传功能也存在在缺陷。
+		'          在参考 宝玉 的 Asp无组件上传带进度条 演示程序后作出如下修改，以修正在iis6下的错误。
+
+		Dim nTotalBytes, nPartBytes, ReadBytes
+		ReadBytes = 0
+		nTotalBytes = Request.TotalBytes
+		'循环分块读取
+		Do While ReadBytes < nTotalBytes
+			'分块读取
+			nPartBytes = 64 * 1024 '分成每块64k
+			If nPartBytes + ReadBytes > nTotalBytes Then 
+				nPartBytes = nTotalBytes - ReadBytes
+			End If
+			oSourceData.Write Request.BinaryRead(nPartBytes)
+			ReadBytes = ReadBytes + nPartBytes
+		Loop
+		'**********************************************
 		oSourceData.Position = 0
-
+		
 		Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary
-
+		
 		oTotalData	= oSourceData.Read
 		bCrLf		= ChrB(13) & ChrB(10)
@@ -126,10 +149,10 @@
 		nBoundLen	= LenB(sBoundary) + 2
 		nFormStart	= nBoundLen
-
+		
 		Set oFormStream = Server.CreateObject("ADODB.Stream")
-
+		
 		Do While (nFormStart + 2) < nTotalSize
 			nFormEnd	= InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3
-
+			
 			With oFormStream
 				.Type	= 1
@@ -144,10 +167,10 @@
 				.Close
 			End With
-
+			
 			nFormStart	= InStrB(nFormEnd, oTotalData, sBoundary) - 1
 			nPosStart	= InStr(22, sFormHeader, " name=", 1) + 7
 			nPosEnd		= InStr(nPosStart, sFormHeader, """")
 			sFormName	= Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
-
+			
 			If InStr(45, sFormHeader, " filename=", 1) > 0 Then
 				Set File(sFormName)			= New NetRube_FileInfo
@@ -177,8 +200,8 @@
 				End With
 			End If
-
+			
 			nFormStart	= nFormStart + nBoundLen
 		Loop
-
+		
 		oTotalData = ""
 		Set oFormStream = Nothing
@@ -190,10 +213,10 @@
 			Exit Sub
 		End If
-
+		
 		If Not IsAllowed(File(sItem).Ext) Then
 			nErr = 4
 			Exit Sub
 		End If
-
+		
 		Dim oFileStream
 		Set oFileStream = Server.CreateObject("ADODB.Stream")
@@ -210,5 +233,5 @@
 		Set oFileStream = Nothing
 	End Sub
-
+	
 	Private Function IsAllowed(sExt)
 		Dim oRE
@@ -216,5 +239,5 @@
 		oRE.IgnoreCase	= True
 		oRE.Global		= True
-
+		
 		If sDenied = "" Then
 			oRE.Pattern	= sAllowed
@@ -224,5 +247,5 @@
 			IsAllowed	= Not oRE.Test(sExt)
 		End If
-
+		
 		Set oRE	= Nothing
 	End Function
@@ -232,3 +255,3 @@
 	Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start
 End Class
-%>
+%>
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/cfm/connector.cfm
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/cfm/connector.cfm	(revision 353)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/cfm/connector.cfm	(revision 354)
@@ -47,4 +47,8 @@
 	userFilesPath = config.userFilesPath;
 
+	if ( userFilesPath eq "" ) { 
+		userFilesPath = "/userfiles/"; 
+	} 
+
 	// make sure the user files path is correctly formatted
 	userFilesPath = replace(userFilesPath, "\", "/", "ALL");
@@ -78,6 +82,10 @@
 	if ( len(config.serverPath) ) {
 		serverPath = config.serverPath;
+
+		if ( right(serverPath,1) neq fs ) { 
+			serverPath = serverPath & fs; 
+		} 
 	} else {
-		serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"");
+		serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
 	}
 
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/cfm/upload.cfm
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/cfm/upload.cfm	(revision 353)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/cfm/upload.cfm	(revision 354)
@@ -36,4 +36,8 @@
 		userFilesPath = config.userFilesPath;
 
+		if ( userFilesPath eq "" ) { 
+			userFilesPath = "/userfiles/"; 
+		} 
+
 		// make sure the user files path is correctly formatted
 		userFilesPath = replace(userFilesPath, "\", "/", "ALL");
@@ -67,6 +71,10 @@
 		if ( len(config.serverPath) ) {
 			serverPath = config.serverPath;
+
+			if ( right(serverPath,1) neq fs ) { 
+				serverPath = serverPath & fs; 
+			} 
 		} else {
-			serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"");
+			serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
 		}
 
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php	(revision 353)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php	(revision 354)
@@ -134,5 +134,16 @@
 	$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
 
-	return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
+	// Get the slash according to the filesystem
+	$slash = ( strpos( $sRealPath, '/' ) === false ) ? '\\' : '/' ;
+	$sSelfPath = str_replace('/', $slash, $sSelfPath) ;
+	
+	$position = strpos($sRealPath, $sSelfPath) ;
+
+	// This can check only that this script isn't run from a virtual dir
+	// But it avoids problems the problems that arise if it isn't checked
+	if ( $position === false || $position <> strlen( $sRealPath ) - strlen( $sSelfPath ) )
+		SendError( 1, "Sorry, can't map 'UserFilesPath' to a physical path. You must set the 'UserFilesAbsolutePath' value " . $position) ;
+
+	return substr( $sRealPath, 0, $position ) ;
 }
 
