Rev 1075 | Blame | Last modification | View Log | RSS feed
<!--* FCKeditor - The text editor for internet* Copyright (C) 2003-2006 Frederico Caldeira Knabben** Licensed under the terms of the GNU Lesser General Public License:* http://www.opensource.org/licenses/lgpl-license.php** For further information visit:* http://www.fckeditor.net/** "Support Open Source software. What about a donation today?"** File Name: io.asp* This file include IO specific functions used by the ASP Connector.** File Authors:* Frederico Caldeira Knabben (fredck@fckeditor.net)--><%Function GetUrlFromPath( resourceType, folderPath )If resourceType = "" ThenGetUrlFromPath = RemoveFromEnd( sUserFilesPath, "/" ) & folderPathElseGetUrlFromPath = sUserFilesPath & resourceType & folderPathEnd IfEnd FunctionFunction RemoveExtension( fileName )RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 )End FunctionFunction ServerMapFolder( resourceType, folderPath )' Get the resource type directory.Dim sResourceTypePathsResourceTypePath = sUserFilesDirectory & resourceType & "\"' Ensure that the directory exists.CreateServerFolder sResourceTypePath' Return the resource type directory combined with the required path.ServerMapFolder = sResourceTypePath & RemoveFromStart( folderPath, "/" )End FunctionSub CreateServerFolder( folderPath )Dim oFSOSet oFSO = Server.CreateObject( "Scripting.FileSystemObject" )Dim sParentsParent = oFSO.GetParentFolderName( folderPath )' Check if the parent exists, or create it.If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent )If ( oFSO.FolderExists( folderPath ) = False ) ThenoFSO.CreateFolder( folderPath )End IfSet oFSO = NothingEnd SubFunction IsAllowedExt( extension, resourceType )Dim oRESet oRE = New RegExpoRE.IgnoreCase = TrueoRE.Global = TrueDim sAllowed, sDeniedsAllowed = ConfigAllowedExtensions.Item( resourceType )sDenied = ConfigDeniedExtensions.Item( resourceType )IsAllowedExt = TrueIf sDenied <> "" ThenoRE.Pattern = sDeniedIsAllowedExt = Not oRE.Test( extension )End IfIf IsAllowedExt And sAllowed <> "" ThenoRE.Pattern = sAllowedIsAllowedExt = oRE.Test( extension )End IfSet oRE = NothingEnd Function%>