/*++++++++++++++++*/
log("GetRootPath():".$STR);
$config["root_path"] = str_replace( '\\', '/', $config["root_path"] );
//$Log->log("root_path | ".$config["root_path"]);
$config["uploads_path"] = str_replace( '\\', '/', $config["uploads_path"] );
//$Log->log("uploads_path | ".$config["uploads_path"]);
$pos = strrpos($STR, "/");
$ult = substr($STR, $pos+1, strlen($STR)-$pos);
//$Log->log("ultima | ".$ult);
$pos = strrpos($config["uploads_path"], $ult);
while($config["uploads_path"][$pos] != "/")
$pos++;
/*
$Log->log("Pos ".$pos);
$Log->log("uploads_path[pos] ".$config["uploads_path"][$pos]);
*/
$usrfp = substr($config["uploads_path"], $pos)."/";
$GLOBALS["UserFilesPath"] = $usrfp ;
/*
$GLOBALS["UserFilesDirectory"] = str_replace( '\\', '/', GetRootPath() ) . str_replace( '\\', '/', $GLOBALS["UserFilesPath"] ) ;
$Log->log("UserFilesPath | ".$GLOBALS["UserFilesPath"]);
$Log->log("UserFilesDirectory | ".$GLOBALS["UserFilesDirectory"]);
$Log->close();
*/
}
// Map the "UserFiles" path to a local directory.
$GLOBALS["UserFilesDirectory"] = str_replace( '\\', '/', GetRootPath() ).str_replace( '\\', '/', $GLOBALS["UserFilesPath"] ) ;
DoResponse() ;
function DoResponse()
{
if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) )
return ;
// Get the main request informaiton.
$sCommand = $_GET['Command'] ;
$sResourceType = $_GET['Type'] ;
$sCurrentFolder = $_GET['CurrentFolder'] ;
// Check the current folder syntax (must begin and start with a slash).
if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ( $sCommand == 'FileUpload' )
{
FileUpload( $sResourceType, $sCurrentFolder ) ;
return ;
}
// Prevent the browser from caching the result.
// Date in the past
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
// always modified
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
// HTTP/1.1
header('Cache-Control: no-store, no-cache, must-revalidate') ;
header('Cache-Control: post-check=0, pre-check=0', false) ;
// HTTP/1.0
header('Pragma: no-cache') ;
// Set the response format.
header( 'Content-Type:text/xml; charset=utf-8' ) ;
CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ;
// Execute the required command.
switch ( $sCommand )
{
case 'GetFolders' :
GetFolders( $sResourceType, $sCurrentFolder ) ;
break ;
case 'GetFoldersAndFiles' :
GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ;
break ;
case 'CreateFolder' :
CreateFolder( $sResourceType, $sCurrentFolder ) ;
break ;
}
CreateXmlFooter() ;
exit ;
}
?>
/*++++++++++++++++++++++*/
I verified this, in locale and on my website with Linux server.
It go well, try it
Bye.