FSO操作文件系统(4)


    End IF

'效验名称
Function IsvalidFileName(File_Name)
    IsvalidFileName = False
    Dim re,reStr
    Set re=new RegExp
    re.IgnoreCase =True
    re.Global=True
    re.Pattern="[^_\.a-zA-Z\d]"
    reStr=re.Replace(File_Name,"")
    If File_Name = reStr Then IsvalidFileName=True
    Set re=Nothing
End Function

%>

upload.asp // 上传类
复制代码 代码如下:

<%
Dim oUpFileStream

Class Upload_File

    Dim Form,File,Err

    Private Sub Class_Initialize
        Err=-1
    End Sub

    Private Sub Class_Terminate 
        'Clear Variables & Objects
        If Err < 0 Then
            oUpFileStream.Close
            Form.RemoveAll
            File.RemoveAll
            Set Form=Nothing
            Set File=Nothing
            Set oUpFileStream =Nothing
        End If
    End Sub

    Public Sub GetDate(RetSize)
        'Define Variables
        Dim RequestBinDate,sStart,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,oFileInfo
        Dim iFileSize,sFilePath,sFileType,sFormvalue,sFileName
        Dim iFindStart,iFindEnd
        Dim iFormStart,iFormEnd,sFormName

        If Request.TotalBytes < 1 Then
            Err=1
            Exit Sub
        End If
        If RetSize > 0 Then 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3693.html