Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/basexml.php
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/basexml.php	(revision 385)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/basexml.php	(revision 386)
@@ -54,5 +54,5 @@
 
 	// Add the current folder node.
-	echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder ) ) . '" />' ;
+	echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ;
 
 	$GLOBALS['HeaderSent'] = true ;
@@ -66,15 +66,22 @@
 function SendError( $number, $text )
 {
-	SetXmlHeaders() ;
+	if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
+	{ 
+		SendErrorNode( $number, $text ) ;
+		CreateXmlFooter() ;
+	}
+	else
+	{
+		SetXmlHeaders() ;
 
-	// Create the XML document header
-	echo '<?xml version="1.0" encoding="utf-8" ?>' ;
+		// Create the XML document header
+		echo '<?xml version="1.0" encoding="utf-8" ?>' ;
 
-	echo '<Connector>' ;
-	
-	SendErrorNode(  $number, $text ) ;
-	
-	echo '</Connector>' ;
-
+		echo '<Connector>' ;
+		
+		SendErrorNode( $number, $text ) ;
+		
+		echo '</Connector>' ;
+	}
 	exit ;
 }
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php	(revision 385)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php	(revision 386)
@@ -45,5 +45,5 @@
 
 		// Map the "UserFiles" path to a local directory.
-		return GetRootPath() . $Config['QuickUploadPath'][$resourceType] ;
+		return Server_MapPath( $Config['QuickUploadPath'][$resourceType] ) ;
 	}
 	else
@@ -53,5 +53,5 @@
 
 		// Map the "UserFiles" path to a local directory.
-		return GetRootPath() . $Config['FileTypesPath'][$resourceType] ;
+		return Server_MapPath( $Config['FileTypesPath'][$resourceType] ) ;
 	}
 }
@@ -75,16 +75,5 @@
 	$sErrorMsg = CreateServerFolder( $sResourceTypePath ) ;
 	if ( $sErrorMsg != '' )
-	{
-		if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
-		{ 
-			SendErrorNode( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ;
-			CreateXmlFooter() ;
-			exit ;
-		}
-		else
-		{
-			SendError( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ;
-		}
-	}
+		SendError( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ;
 
 	// Return the resource type directory combined with the required path.
@@ -149,12 +138,10 @@
 	$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
 
-	// Get the slash according to the filesystem
-	$slash = ( strpos( $sRealPath, '/' ) === false ) ? '\\' : '/' ;
-	$sSelfPath = str_replace( '/', $slash, $sSelfPath ) ;
+	$sSelfPath = str_replace( '/', DIRECTORY_SEPARATOR, $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
+	// But it avoids 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 in "editor/filemanager/connectors/php/config.php".' ) ;
@@ -163,4 +150,19 @@
 }
 
+// Emulate the asp Server.mapPath function.
+// given an url path return the physical directory that it corresponds to
+function Server_MapPath( $path )
+{
+	// This function is available only for Apache
+	if ( function_exists( 'apache_lookup_uri' ) )
+	{
+		$info = apache_lookup_uri( $path ) ;
+		return $info->filename . $info->path_info ;
+	}
+
+	// This isn't correct but for the moment there's no other solution
+	// If this script is under a virtual directory or symlink it will detect the problem and stop
+	return GetRootPath() . $path ;
+}
 
 function IsAllowedExt( $sExtension, $resourceType )
