我需要找出 文件上传的路径 , 是在哪里??
FCK 浏览服务器 功能
function GetUrlParam( paramName )
{
var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
var oMatch = oRegex.exec( window.top.location.search ) ;
if ( oMatch && oMatch.length > 1 )
return oMatch[1] ;
else
return '' ;
}var oConnector = new Object() ;
oConnector.CurrentFolder = '/' ;var sConnUrl = GetUrlParam( 'Connector' ) ;// Gecko has some problems when using relative URLs (not starting with slash).
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;var sServerPath = GetUrlParam( 'ServerPath' ) ;
if ( sServerPath.length > 0 )
oConnector.ConnectorUrl += 'ServerPath=' + escape( sServerPath ) + '&' ;oConnector.ResourceType = GetUrlParam( 'Type' ) ;
oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ;if ( oConnector.ShowAllTypes )
oConnector.ResourceType = 'File' ;oConnector.SendCommand = function( command, params, callBackFunction )
{
var sUrl = this.ConnectorUrl + 'Command=' + command ;
sUrl += '&Type=' + this.ResourceType ;
sUrl += '&CurrentFolder=' + escape( this.CurrentFolder ) ;
if ( params ) sUrl += '&' + params ; var oXML = new FCKXml() ;
if ( callBackFunction )
oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load.
else
return oXML.LoadUrl( sUrl ) ;
}oConnector.CheckError = function( responseXml )
{
var iErrorNumber = 0
var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
if ( oErrorNode )
{
iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value ) ;
switch ( iErrorNumber )
{
case 0 :
break ;
case 1 : // Custom error. Message placed in the "text" attribute.
alert( oErrorNode.attributes.getNamedItem('text').value ) ;
break ;
case 101 :
alert( '文件夹已存在。' ) ;
break ;
case 102 :
alert( '无效的文件夹名。' ) ;
break ;
case 103 :
alert( '新建文件夹权限不足,请检查服务器。' ) ;
break ;
case 110 :
alert( '未知错误,不能新建文件夹。' ) ;
break ;
default :
alert( '请求错误,错误代号: ' + iErrorNumber ) ;
break ;
}
}
return iErrorNumber ;
}var oIcons = new Object() ;oIcons.AvailableIconsArray = [
'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
'mdb','mp3','pdf','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
oIcons.AvailableIcons = new Object() ;for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;oIcons.GetIcon = function( fileName )
{
var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ; if ( this.AvailableIcons[ sExtension ] == true )
return sExtension ;
else
return 'default.icon' ;
}
FCK 浏览服务器 功能
function GetUrlParam( paramName )
{
var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
var oMatch = oRegex.exec( window.top.location.search ) ;
if ( oMatch && oMatch.length > 1 )
return oMatch[1] ;
else
return '' ;
}var oConnector = new Object() ;
oConnector.CurrentFolder = '/' ;var sConnUrl = GetUrlParam( 'Connector' ) ;// Gecko has some problems when using relative URLs (not starting with slash).
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;var sServerPath = GetUrlParam( 'ServerPath' ) ;
if ( sServerPath.length > 0 )
oConnector.ConnectorUrl += 'ServerPath=' + escape( sServerPath ) + '&' ;oConnector.ResourceType = GetUrlParam( 'Type' ) ;
oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ;if ( oConnector.ShowAllTypes )
oConnector.ResourceType = 'File' ;oConnector.SendCommand = function( command, params, callBackFunction )
{
var sUrl = this.ConnectorUrl + 'Command=' + command ;
sUrl += '&Type=' + this.ResourceType ;
sUrl += '&CurrentFolder=' + escape( this.CurrentFolder ) ;
if ( params ) sUrl += '&' + params ; var oXML = new FCKXml() ;
if ( callBackFunction )
oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load.
else
return oXML.LoadUrl( sUrl ) ;
}oConnector.CheckError = function( responseXml )
{
var iErrorNumber = 0
var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
if ( oErrorNode )
{
iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value ) ;
switch ( iErrorNumber )
{
case 0 :
break ;
case 1 : // Custom error. Message placed in the "text" attribute.
alert( oErrorNode.attributes.getNamedItem('text').value ) ;
break ;
case 101 :
alert( '文件夹已存在。' ) ;
break ;
case 102 :
alert( '无效的文件夹名。' ) ;
break ;
case 103 :
alert( '新建文件夹权限不足,请检查服务器。' ) ;
break ;
case 110 :
alert( '未知错误,不能新建文件夹。' ) ;
break ;
default :
alert( '请求错误,错误代号: ' + iErrorNumber ) ;
break ;
}
}
return iErrorNumber ;
}var oIcons = new Object() ;oIcons.AvailableIconsArray = [
'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
'mdb','mp3','pdf','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
oIcons.AvailableIcons = new Object() ;for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;oIcons.GetIcon = function( fileName )
{
var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ; if ( this.AvailableIcons[ sExtension ] == true )
return sExtension ;
else
return 'default.icon' ;
}
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;alert(sConnUrl);是这个url的服务端脚本文件控制的
SendError( 1, '�ù�����δ��� �����ļ� "editor/filemanager/browser/default/connectors/php/config.php" ' ) ;// Get the "UserFiles" path.
$GLOBALS["UserFilesPath"] = '' ;if ( isset( $Config['UserFilesPath'] ) )
$GLOBALS["UserFilesPath"] = $Config['UserFilesPath'] ;
else if ( isset( $_GET['ServerPath'] ) )
$GLOBALS["UserFilesPath"] = $_GET['ServerPath'] ;
else
$GLOBALS["UserFilesPath"] = '/UserFiles/' ;if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;if ( strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
{
$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ; if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
$GLOBALS["UserFilesDirectory"] .= '/' ;
}
else
{
// Map the "UserFiles" path to a local directory.
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $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 if it is an allowed type.
if ( !in_array( $sResourceType, array('File','Image','Flash','Media') ) )
return ; // Check the current folder syntax (must begin and start with a slash).
if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
// Check for invalid folder paths (..)
if ( strpos( $sCurrentFolder, '..' ) )
SendError( 102, "" ) ; // File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ( $sCommand == 'FileUpload' )
{
FileUpload( $sResourceType, $sCurrentFolder ) ;
return ;
} 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 ;
}
if ( isset( $Config['UserFilesPath'] ) )
$GLOBALS["UserFilesPath"] = $Config['UserFilesPath'] ;
// 没有设置$Config['UserFilesPath'],就从get中取ServerPath
else if ( isset( $_GET['ServerPath'] ) )
$GLOBALS["UserFilesPath"] = $_GET['ServerPath'] ;
// 上述都没有的话,就指定一个“/UserFiles/”
else
$GLOBALS["UserFilesPath"] = '/UserFiles/' ;// 目录不是以/结尾,追加/ (例如 /a 则变成 /a/)
if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;// 如果设置了绝对地址,则用绝对地址
if ( strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
{
$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ; if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
$GLOBALS["UserFilesDirectory"] .= '/' ;
}// 没有则获取一个根路径 + 上面获取的相对路径地址
else
{
// Map the "UserFiles" path to a local directory.
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
}