io.asp
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. <!--
  2.  * FCKeditor - The text editor for internet
  3.  * Copyright (C) 2003-2006 Frederico Caldeira Knabben
  4.  * 
  5.  * Licensed under the terms of the GNU Lesser General Public License:
  6.  *  http://www.opensource.org/licenses/lgpl-license.php
  7.  * 
  8.  * For further information visit:
  9.  *  http://www.fckeditor.net/
  10.  * 
  11.  * "Support Open Source software. What about a donation today?"
  12.  * 
  13.  * File Name: io.asp
  14.  *  This file include IO specific functions used by the ASP Connector.
  15.  * 
  16.  * File Authors:
  17.  *  Frederico Caldeira Knabben (fredck@fckeditor.net)
  18. -->
  19. <%
  20. Function GetUrlFromPath( resourceType, folderPath )
  21. If resourceType = "" Then
  22. GetUrlFromPath = RemoveFromEnd( sUserFilesPath, "/" ) & folderPath
  23. Else
  24. GetUrlFromPath = sUserFilesPath & resourceType & folderPath
  25. End If
  26. End Function
  27. Function RemoveExtension( fileName )
  28. RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 )
  29. End Function
  30. Function ServerMapFolder( resourceType, folderPath )
  31. ' Get the resource type directory.
  32. Dim sResourceTypePath
  33. sResourceTypePath = sUserFilesDirectory & resourceType & ""
  34. ' Ensure that the directory exists.
  35. CreateServerFolder sResourceTypePath
  36. ' Return the resource type directory combined with the required path.
  37. ServerMapFolder = sResourceTypePath & RemoveFromStart( folderPath, "/" )
  38. End Function
  39. Sub CreateServerFolder( folderPath )
  40. Dim oFSO
  41. Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
  42. Dim sParent
  43. sParent = oFSO.GetParentFolderName( folderPath )
  44. ' Check if the parent exists, or create it.
  45. If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent )
  46. If ( oFSO.FolderExists( folderPath ) = False ) Then 
  47. oFSO.CreateFolder( folderPath )
  48. End If
  49. Set oFSO = Nothing
  50. End Sub
  51. Function IsAllowedExt( extension, resourceType )
  52. Dim oRE
  53. Set oRE = New RegExp
  54. oRE.IgnoreCase = True
  55. oRE.Global = True
  56. Dim sAllowed, sDenied
  57. sAllowed = ConfigAllowedExtensions.Item( resourceType )
  58. sDenied = ConfigDeniedExtensions.Item( resourceType )
  59. IsAllowedExt = True
  60. If sDenied <> "" Then
  61. oRE.Pattern = sDenied
  62. IsAllowedExt = Not oRE.Test( extension )
  63. End If 
  64. If IsAllowedExt And sAllowed <> "" Then
  65. oRE.Pattern = sAllowed
  66. IsAllowedExt = oRE.Test( extension )
  67. End If
  68. Set oRE = Nothing
  69. End Function
  70. %>