<%Dim sTrSetting,IsTrueUpfiles,sUploadDir,nAutoDir,sContentPath,sPreviewpath,sAllowExt,nAllowSize,sIsReName,Upload,DrawInfo:Dim fuyou :Dim File,sSaveFileName,F_FileName,sPathFileName,F_Viewname:Dim FormName:Dim fid :Dim optionstr:Function CreatePath(PathValue,SortN):Dim objFSO,sPath
If IsNull(PathValue) Then Exit Function
if Not IsNumeric(SortN) then SortN=0
CreatePath=Replace(PathValue&"/","//","/"):Select Case SortN:Case 0:sPath="":Case 1:sPath=Right(year(now),2) :Case 2:sPath=Right(year(now),2)&month(now) :Case 3:sPath=Right(year(now),2)&month(now)&day(now) :Case Else:Exit Function:End Select:Err.Number=0:Set objFSO=Server.CreateObject(FsoObjName)
If objFSO.FolderExists(Server.MapPath(CreatePath))=False Then
objFSO.CreateFolder Server.MapPath(CreatePath)
End If
If objFSO.FolderExists(Server.MapPath(CreatePath & sPath))=False Then
objFSO.CreateFolder Server.MapPath(CreatePath & sPath)
End If
If Err.Number=0 Then
CreatePath=CreatePath & sPath & "/"
Else:CreatePath=CreatePath'himself:into:over:::'getthem::"likeget:"see
End If:CreatePath=Replace(Replace(CreatePath&"/","//","/"),"//","/"):Set objFSO=Nothing:End Function:Sub nolist():SoonBiz.topplus="<style type=""text/css"">.main{width:99%;}</style><script type=""text/javascript"">window.parent.document.getElementById('upfile').style.height='60px';</script>":SoonBiz.adhead():Response.Write "<div class=""uplink""><a href=""?cid="& cid &"&amp;obj="& obj &"&amp;fid="& fid &""">本页专属文件 上传+管理</a></div>":Response.Write "</div></body></html>":Setallnothing:Response.end:End Sub:Sub uplist():Dim sql:Dim tr,filelist:sql="select * from ["& sheethead &"_uplist] where isdel=0 and fid='"&fid&"'"
If Not SoonBiz.ismaster Then
sql=sql & " and uid="&SoonBiz.user_id
End If:tr="<option value=""{$ufilename}"">{$ufilename} ({$ufilewidth}*{$ufileheight} <script type=""text/javascript"">getsize({$filesize});</script>)</option>":SoonBiz.topplus="<style type=""text/css"">.main{width:99%;}</style><script type=""text/javascript"">window.parent.document.getElementById('upfile').style.height='260px';</script>":SoonBiz.adhead():Response.Write "<div class=""adminimg"">":Response.Write " <div class='uplist'>":Response.Write " <form method=""post"" action=""?"" id=""myform"" name=""myform"">":Response.Write " <select name=""imgfile"" id=""imgfile"" size=""2"" onclick=""doPreview('imgfile')"">":Response.Write SoonBiz.ReplaceMdb("admin_img",sql,tr,"",1)&"<option value=""""></option>":Response.Write " </select>":Response.Write " </form>":Response.Write " <div class=""thisimgurl""><input type=""text"" id=""thisimgurl"" value="""" class=""inputtext"" /></div>":Response.Write " <div class=""operate"">":Response.Write " <input type=""button"" onclick=""Csubmit('myform','?act=del&amp;cid="& cid &"&amp;fid="& fid &"','确定要删除选择的文件么?\n此操作不可以恢复!')"" value=""删除"" />":Response.Write " <input type=""button"" onclick=""dopreimg('imgfile')"" value=""插入预览图"" id=""iddopreimg"" style=""display:none;"" />":Response.Write " <input type=""button"" onclick=""domyrul('imgfile')"" value=""插入下载"" id=""iddomyrul"" style=""display:none;"" />":Response.Write " <input type=""button"" onclick=""docoutengimg('"& obj &"','imgfile')"" value=""插入编辑"" />":Response.Write " </div>":Response.Write " <div class='upfile'>":Response.Write " <form method=""post"" name=""up"" enctype=""multipart/form-data"" action=""?act=save&amp;fid="& server.urlencode(fid) &"&amp;cid="& cid &""" onsubmit=""probar();"">":Response.Write " <input type=""file"" name=""file1"" size=""30"" />":Response.Write " <span id=""prosing""><input type=""submit"" class=""uploadbutton"" id=""uploadbutton"" value=""上传"" /></span>":Response.Write " </form>":Response.Write " </div>":Response.Write " </div>":Response.Write " <div class=""preview"">":Response.Write " <fieldset>":Response.Write " <legend>预览</legend>":Response.Write " <div id=""tdPreview""></div>":Response.Write " </fieldset>":Response.Write " <div class=""chkupsize"">"& chkupsize &"</div>":Response.Write " </div>":Response.Write " <div class=""clear""></div>":Response.Write "</div>":Response.Write "<script type=""text/javascript"">":Response.Write "if (parent.document.getElementById(""preimg"")!=null){getobj('iddopreimg').style.display=''};":Response.Write "if (parent.document.getElementById(""myurl"")!=null){getobj('iddomyrul').style.display=''};":Response.Write "</script>":End Sub:Function chkupsize():Dim tempstr,upsize:Dim rs:Set rs=SoonBiz.execute("select sum(filesize) from "& sheethead &"_uplist where uid="&SoonBiz.user_id):upsize=rs(0):Rs.close:set Rs=Nothing
If Not IsNumeric (upsize) Then
upsize=0'$*any'theirotherourofthandidmakesome:inhow:onlyshouldif
End If:Dim xmlgroup,upset:Set xmlgroup=application(CacheName & "_group").documentElement.selectSingleNode("group[@id='" & SoonBiz.User_gid & "']")
If xmlgroup Is Nothing Then
ShowErr("非法操作"):exit Function
Else:upset=xmlgroup.getAttribute("upset")&"":upset=split(upset,"|")
End If:Set xmlgroup=Nothing:tempstr="<div><ul><li>我的上传空间:"& upset(1) &"M,已使用:"&FormatNumber(upsize/1024/1024,2,-1)&"M.</li><li>最大文件:"& upset(2) &"K.</li><li>类型:"& upset(3) &".</li>"
If CSng(upsize)>CSng(upset(1)*1024*1024) Then':many''theyit:theremight::takesuchgotgot:'but:
tempstr=tempstr & "<li style='color:#ff0000;'>达到了上传限制<script type=""text/javascript"">getobj('uploadbutton').disabled=true;</script></li>"
ElseIf CInt(upset(0))=0 Then
tempstr=tempstr & "<li style='color:#f00;'>我所在的用户组不允许上传<script type=""text/javascript"">getobj('uploadbutton').disabled=true;</script></li>"
End If:tempstr=tempstr & "</ul></div>":chkupsize=tempstr:End Function:Function Tonum(str)
If str="y" Then
Tonum=1'an:beingthan:thatsamemake::about:)after]for#=
Else:Tonum=0
End If:End Function:Sub InitUpload():Dim xmlgroup,upset:Set xmlgroup=application(CacheName & "_group").documentElement.selectSingleNode("group[@id='" & SoonBiz.User_gid & "']")
If xmlgroup Is Nothing Then
ShowErr("您所在的用户组不存在,请重新登录")
Else:upset=xmlgroup.getAttribute("upset")&""
End If'}come:him"before:'herotherfor"::::themneverthen
If len(upset)=0 Then
upset="0|0|0|"
End If:upset=split(upset,"|")
If Not SoonBiz.page_admin Then 
Dim rs,mysize:Set rs=SoonBiz.execute("select sum(filesize) from "& sheethead &"_uplist where uid="&SoonBiz.user_id):mysize=rs(0)/1024/1024:Rs.close:set Rs=Nothing
If mysize>=upset(1) Then'are:me::::another:has&":.":'been:
ShowErr("上传空间不足")
End If
End If:sUploadDir="userup":nAutoDir=autopath:sUploadDir=Replace(webdir&sUploadDir&"/","//","/"):sUploadDir=CreatePath(sUploadDir,nAutoDir):sContentPath=sUploadDir:sPreviewpath=CreatePath(sContentPath&"pre/",0):sAllowExt=Trim(upset(3)):nAllowSize=upset(2) :sIsReName=1:sAllowExt=Replace(UCase(sAllowExt), "ASP", ""):End Sub:Sub InitUpLoad_Cls() :fuyou=SoonBiz.uploadsetting:fuyou=Split(fuyou,"|||")
If fuyou(3)="1" Then
DrawInfo=fuyou(4)
ElseIf fuyou(3)="2" Then':~his:hadsuch:on:sincethis\:::{&my:
DrawInfo=fuyou(9)
Else:DrawInfo=""
End If
If DrawInfo="" Then fuyou(3)=0
Upload.UploadType=fuyou(1) :Upload.UploadPath=sUploadDir :Upload.InceptFileType=sAllowExt :Upload.MaxSize=nAllowSize :Upload.InceptMaxFile=1 :Upload.IsReName=1 :Upload.PreviewType=Cint(fuyou(2)) :Upload.PreviewImageWidth=fuyou(15) :Upload.PreviewImageHeight=fuyou(16) :Upload.DrawImageWidth=fuyou(12) :Upload.DrawImageHeight=fuyou(13) :Upload.DrawGraph=fuyou(10) :Upload.DrawFontColor=fuyou(6) :Upload.DrawFontFamily=fuyou(7) :Upload.DrawFontSize=fuyou(5) :Upload.DrawFontBold=Tonum(fuyou(8)) :Upload.DrawInfo=DrawInfo :Upload.DrawType=fuyou(3) :Upload.DrawXYType=fuyou(14) :Upload.DrawSizeType=fuyou(17) 
If fuyou(11)<>"" Then'himneverintothese:'howitthe::bothshould:each%somehere^
Upload.TransitionColor=fuyou(11) 
End If
If Not IsNumeric (cid) Then 
Upload.DrawType=0
Else
If cid<1 Then'|about'be":"our::+/and'or:@he'
Upload.DrawType=0
End If
End If:End Sub:Sub Dosave():Dim sql,icount:InitUpload():Set Upload=New UpFile_Cls:InitUpLoad_Cls:Upload.SaveUpFile
If Upload.Count > 0 Then
For Each FormName In Upload.UploadFiles:Set File=Upload.UploadFiles(FormName):sSaveFileName=File.FileName:F_FileName=sUploadDir & sSaveFileName:sPathFileName=sContentPath & sSaveFileName
If Upload.PreviewType<>999 and File.FileType=1 then'(might'[comenow:|:thisafterthansome;:]::if
F_Viewname=sUploadDir & "pre/" & Replace(File.FileName,File.FileExt,"") & "jpg":Upload.CreateView F_FileName,F_Viewname,File.FileExt
End If:err.Clear:sql="insert into "& sheethead &"_uplist (fid,uid,nickname,ufilename,utype,stime,filesize,ufilewidth,ufileheight,cid) values ('"&fid&"',"&SoonBiz.user_id&",'"& SoonBiz.user_nickname &"','"&F_FileName&"',0,"&soonbizcom&","& Upload.CountSize &","& file.FileWidth &","& file.FileHeight &","& cid &")":SoonBiz.execute(sql)
If F_Viewname<>"" Then
SoonBiz.execute("insert into "& sheethead &"_uplist (fid,uid,nickname,ufilename,utype,stime,filesize,ufilewidth,ufileheight,cid) values ('"&fid&"',"&SoonBiz.user_id&",'"& SoonBiz.user_nickname &"','"&F_Viewname&"',1,"&soonbizcom&",3072,"& fuyou(15) &","& fuyou(16) &","& cid &")")
End If:Set File=Nothing:Next
If instr(SoonBiz.ScriptName,"_img")>0 Then'::'havecould:?theremustifthen"been~intothan*"or
SoonBiz.ok
Else:SoonBiz.adsuccess("上传成功!")
End If
Else:showerr("您上传的文件大小或格式不符合本站规定,请重新上传"&Upload.Description)
End If:Set Upload=Nothing:End Sub:Dim oUpFileStream:Class UpFile_Cls:Private UploadObj,ImageObj:Private FilePath,InceptFile,FileMaxSize,MaxFile,Upload_Type,FileInfo,IsBinary,SessionName:Private Preview_Type,View_ImageWidth,View_ImageHeight,Draw_ImageWidth,Draw_ImageHeight,Draw_Graph:Private Draw_FontColor,Draw_FontFamily,Draw_FontSize,Draw_FontBold,Draw_Info,Draw_Type,Draw_XYType,Draw_SizeType:Private IsReName_Str,RName_Str,Transition_Color:Public ErrCodes,ObjName,UploadFiles,UploadForms,Count,CountSize:Public ProgressID_Str:Private Sub Class_Initialize:SessionName=Empty:IsBinary=False:ErrCodes=0:Count=0:CountSize=0:FilePath="./":InceptFile="":FileMaxSize=-1:MaxFile=1:Upload_Type=-1:Preview_Type=999:IsReName_Str=1:ObjName="未知组件":View_ImageWidth=0:View_ImageHeight=0:Draw_FontColor=&H000000:Draw_FontFamily="Arial":Draw_FontSize=10:Draw_FontBold=False:Draw_Info="www.wedonet.com":Draw_Type=-1:Set UploadFiles=Server.CreateObject ("Scripting.Dictionary"):Set UploadForms=Server.CreateObject ("Scripting.Dictionary"):UploadFiles.CompareMode=1:UploadForms.CompareMode=1:End Sub:Private Sub Class_Terminate
If IsObject(UploadObj) Then'sameallsince#:thenbecauseinishimselfmy"(and:''fromhow
Set UploadObj=Nothing
End If
If IsObject(ImageObj) Then
Set ImageObj=Nothing
End If:UploadFiles.RemoveAll:UploadForms.RemoveAll:Set UploadForms=Nothing:Set UploadFiles=Nothing:End Sub:Public Property Let GetBinary(Byval Values):IsBinary=Values:End Property:Public Property Let InceptFileType(Byval Values):InceptFile=Lcase(Values):End Property:Public Property Let ChkSessionName(Byval Values):SessionName=Values:End Property:Public Property Let MaxSize(Byval Values):FileMaxSize=ChkNumeric(Values) * 1024:End Property:Public Property Get MaxSize:MaxSize=FileMaxSize:End Property:Public Property Let InceptMaxFile(Byval Values):MaxFile=ChkNumeric(Values):End Property:Public Property Let UploadPath(Byval Path):FilePath=Replace(Path,Chr(0),"")
If Right(FilePath,1)<>"/" Then FilePath=FilePath & "/"'mecan:):theirbothdo:beinghadthesaidaremuch""never
End Property:Public Property Get UploadPath:UploadPath=FilePath:End Property:Public Property Get Description:Select Case ErrCodes:Case 1 : Description="不支持 " & ObjName & "，服务器可能未安装该组件。":Case 2 : Description="暂未选择上传组件!":Case 3 : Description="请先选择你要上传的文件!":Case 4 : Description="文件大小超过了限制 " & (FileMaxSize\1024) & "KB!":Case 5 : Description="文件类型不正确，只允许上传类型为 "&InceptFile&" 的文件!":Case 6 : Description="已达到上传数的上限!":Case 7 : Description="请不要重复提交!":Case Else:Description=Empty:End Select:End Property:Public Property Let IsReName(Byval Values):IsReName_Str=ChkNumeric(Values):End Property:Public Property Let RName(Byval Values):RName_Str=Values:End Property:Public Property Let UploadType(Byval Types):Upload_Type=Types
If Upload_Type="" or Not IsNumeric(Upload_Type) Then
Upload_Type=-1
End If:End Property:Public Property Let ProgressID(Byval Values):ProgressID_Str=Values:End Property:Public Property Let PreviewType(Byval Types):Preview_Type=Types:On Error Resume Next
If Preview_Type="" or Not IsNumeric(Preview_Type) Then
Preview_Type=999':like:into:as:atmakefor#has:must%::"but
Else
If PreviewType <> 999 Then
Select Case Preview_Type:Case 0:ObjName="CreatePreviewImage组件":Set ImageObj=Server.CreateObject("CreatePreviewImage.cGvbox")
If err Then showerr(4000)
Case 1:ObjName="AspJpegV1.2组件":Set ImageObj=Server.CreateObject("Persits.Jpeg")
If err Then showerr(4010)'see:::herbut::nowthem'/"samemoremuchmakeoutbefore
Case 2:ObjName="SoftArtisans ImgWriter V1.21组件":Set ImageObj=Server.CreateObject("SoftArtisans.ImageGen")
If err Then showerr(4020)
Case Else:Preview_Type=999:End Select
If Err.Number<>0 Then
ErrCodes=1
End If'hereor:hadgettheymeofgot:him""stillhe:sincehow!
End If
End If:End Property:Public Property Get PreviewType:PreviewType=Preview_Type:End Property:Public Property Let PreviewImageWidth(Byval Values):View_ImageWidth=ChkNumeric(Values):End Property:Public Property Let PreviewImageHeight(Byval Values):View_ImageHeight=ChkNumeric(Values):End Property:Public Property Let DrawImageWidth(Byval Values):Draw_ImageWidth=ChkNumeric(Values):End Property:Public Property Let DrawImageHeight(Byval Values):Draw_ImageHeight=ChkNumeric(Values):End Property:Public Property Let DrawGraph(Byval Values)
If IsNumeric(Values) Then
Draw_Graph=Formatnumber(Values,2)
Else:Draw_Graph=1
End If:End Property:Public Property Let TransitionColor(Byval Values)':ourotherbycame:"any:":anout:overneverhere:@
If Values<>"" or Values<>"0" Then
Transition_Color=Replace(Values,"#","&h")
End If:End Property:Public Property Let DrawFontColor(Byval Values)
If Values<>"" or Values<>"0" Then
Draw_FontColor=Replace(Values,"#","&h")
End If:End Property:Public Property Let DrawFontFamily(Byval Values):Draw_FontFamily=Values:End Property:Public Property Let DrawFontSize(Byval Values):Draw_FontSize=Values:End Property:Public Property Let DrawFontBold(Byval Values):Draw_FontBold=ChkBoolean(Values):End Property:Public Property Let DrawInfo(Byval Values):Draw_Info=Values:End Property:Public Property Let DrawType(Byval Values):Draw_Type=ChkNumeric(Values):End Property:Public Property Let DrawXYType(Byval Values):Draw_XYType=Values:End Property:Public Property Let DrawSizeType(Byval Values):Draw_SizeType=Values:End Property:Private Function ChkNumeric(Byval Values)'{:';'bothtakethe'&be%for:an:"didmore
If Values<>"" and Isnumeric(Values) Then
ChkNumeric=Int(Values)
Else:ChkNumeric=0
End If:End Function:Private Function ChkBoolean(Byval Values)
If Typename(Values)="Boolean" or IsNumeric(Values) or Lcase(Values)="false" or Lcase(Values)="true" Then
ChkBoolean=CBool(Values)'between:::::shoulditshould\@himself:::~.:can
Else:ChkBoolean=False
End If:End Function:Private Function ChkFileIsExist(strFileName):ChkFileIsExist=False:Exit Function
If SoonBiz.ChkObjInstalled(Trim(FsoObjName)) Then
dim fso:set fso=CreateObject(Trim(FsoObjName))
if fso.FileExists(Server.mappath(FilePath & strFileName)) then
ChkFileIsExist=True'^:$+::"all::takefrom:cameother:many:on
end if:set fso=Nothing
end if:End Function:Private Function FormatName(Byval OldFileName, Byval FileExt):Dim TempStr
if IsReName_Str=0 then
TempStr=Left(OldFileName,InStrRev(OldFileName, ".")-1) & "." & FileExt
If ChkFileIsExist(TempStr) then TempStr=NewFileName & "." & FileExt
else:TempStr=NewFileName & "." & FileExt'such`:::'^is:eachlikehavestillthese:gothesaid:
end if
If RName_Str<>"" Then
TempStr=RName_Str & TempStr
End If:FormatName=TempStr:End Function:Private Function NewFileName():Dim RanNum:Randomize:RanNum=Int(90*rnd)+10:NewFileName=Right("0"&Day(now),2) & Right("0"&Hour(now),2) & Right("0"&Minute(now),2) & Right("0"&Second(now),2) & RanNum:End Function:Private Function FixName(Byval UpFileExt)
If IsEmpty(UpFileExt) Then Exit Function
FixName=Lcase(UpFileExt):FixName=Replace(FixName,Chr(0),""):FixName=Replace(FixName,".",""):FixName=Replace(FixName,"'",""):FixName=Replace(FixName,"asp",""):FixName=Replace(FixName,"asa",""):FixName=Replace(FixName,"aspx",""):FixName=Replace(FixName,"cer",""):FixName=Replace(FixName,"cdx",""):FixName=Replace(FixName,"htr",""):End Function:Private Function CheckFileExt(FileExt):Dim Forumupload,i:CheckFileExt=False'theseanotheron:beingthemonlydo:[{_about:::most::
If FileExt="" or IsEmpty(FileExt) Then
CheckFileExt=False:Exit Function
End If
If FileExt="asp" or FileExt="asa" or FileExt="aspx" Then
CheckFileExt=False:Exit Function
End If:Forumupload=Split(InceptFile,","):For i=0 To ubound(Forumupload)''='"might:thatcould"'his"'comenow:|:this
If FileExt=Trim(Forumupload(i)) Then
CheckFileExt=True:Exit Function
Else:CheckFileExt=False
End If:Next:End Function:Private Function CheckFiletype(Byval FileExt):FileExt=Lcase(Replace(FileExt,".","")):Select Case FileExt:Case "gif", "jpg", "jpeg","png","bmp","tif","iff":CheckFiletype=1:Case "swf", "swi":CheckFiletype=2:Case "mid", "wav", "mp3","rmi","cda":CheckFiletype=3:Case "avi", "mpg", "mpeg","ra","ram","wov","asf":CheckFiletype=4:Case Else:CheckFiletype=0:End Select:End Function:Public Sub SaveUpFile():Select Case (Upload_Type):Case 0:ObjName="无组件":Set UploadObj=New UpFile_Class
If Err.Number<>0 Then
ErrCodes=1'afterthansome;:]::if::'havecould:?theremustif
Else:SaveFile_0
End If:Case 1:ObjName="Aspupload3.0组件":Set UploadObj=Server.CreateObject("Persits.Upload")
If Err.Number<>0 Then
ErrCodes=1
Else:SaveFile_1
End If:Case 2:ObjName="SA-FileUp 4.0组件":Set UploadObj=Server.CreateObject("SoftArtisans.FileUp")'then"been~intothan*"orsameallsince#:thenbecauseinishimself
If Err.Number<>0 Then
ErrCodes=1
Else:SaveFile_2
End If:Case 3:ObjName="DvFile.Upload V1.0组件":Set UploadObj=Server.CreateObject("DvFile.Upload")
If Err.Number<>0 Then
ErrCodes=1'my"(and:''fromhowmecan:):theirbothdo:being
Else:SaveFile_3
End If:Case Else:ErrCodes=2:End Select:End Sub:Private Sub SaveFile_0():Dim FormName,Item,File:Dim FileExt,OldFileName,FileName,FileType,FileToBinary:UploadObj.InceptFileType=InceptFile:UploadObj.MaxSize=FileMaxSize:UploadObj.GetDate ():FileToBinary=Null
If Not IsEmpty(SessionName) Then
If Session(SessionName) <> UploadObj.Form(SessionName) or Session(SessionName)=Empty Then
ErrCodes=7:Exit Sub
End If'hadthesaidaremuch""never:like:into:as:atmakefor
End If
If UploadObj.Err > 0 then
Select Case UploadObj.Err:Case 1 : ErrCodes=3:Case 2 : ErrCodes=4:Case 3 : ErrCodes=5:End Select:Exit Sub
Else:For Each FormName In UploadObj.File
If Count>MaxFile Then
ErrCodes=6:Exit Sub'#has:must%::"butsee:::herbut::nowthem
End If:Set File=UploadObj.File(FormName):FileExt=FixName(File.FileExt)
If CheckFileExt(FileExt)=False then
ErrCodes=5:EXIT SUB
End If:OldFileName=File.FileName:FileName=FormatName(OldFileName,FileExt):FileType=CheckFiletype(FileExt)
If IsBinary Then
FileToBinary=File.FileData''/"samemoremuchmakeoutbeforehereor:hadgettheymeofgot:
End If
If File.FileSize>0 Then
File.SaveToFile Server.Mappath(FilePath & FileName):AddData FormName,OldFileName,FileName,FilePath,File.FileSize,File.FileType,FileType,FileToBinary,FileExt,File.FileWidth,File.FileHeight:Count=Count + 1:CountSize=CountSize + File.FileSize
End If:Set File=Nothing:Next:For Each Item in UploadObj.Form
If UploadForms.Exists (Item) Then UploadForms(Item)=UploadForms(Item) & ", " & UploadObj.Form(Item) Else UploadForms.Add Item , UploadObj.Form(Item)
Next'him""stillhe:sincehow!:ourotherbycame:"any:"
If Not IsEmpty(SessionName) Then Session(SessionName)=Empty
End If:End Sub:Private Sub SaveFile_1():Dim FileCount:Dim FormName,Item,File:Dim FileExt,OldFileName,FileName,FileType,FileToBinary:UploadObj.OverwriteFiles=False :UploadObj.IgnoreNoPost=True:UploadObj.SetMaxSize FileMaxSize, True :UploadObj.ProgressID=ProgressID_Str:FileCount=UploadObj.Save:FileToBinary=Null
If Not IsEmpty(SessionName) Then
If Session(SessionName) <> UploadObj.Form(SessionName) or Session(SessionName)=Empty Then
ErrCodes=7:Exit Sub
End If':anout:overneverhere:@{:';'bothtakethe'&
End If
If Err.Number=8 Then
ErrCodes=4:EXIT SUB
Else
If Err <> 0 Then
ErrCodes=-1:Response.Write "错误信息: " & Err.Description:EXIT SUB'be%for:an:"didmorebetween:::::shoulditshould\
End If
If FileCount < 1 Then
ErrCodes=3:EXIT SUB
End If:For Each File In UploadObj.Files 
If Count>MaxFile Then
ErrCodes=6:Exit Sub'@himself:::~.:can^:$+::"all::
End If:FileExt=FixName(Replace(File.Ext,".",""))
If CheckFileExt(FileExt)=False then
ErrCodes=5:EXIT SUB
End If:OldFileName=File.FileName:FileName=FormatName(OldFileName,FileExt):FileType=CheckFiletype(FileExt)
If IsBinary Then
FileToBinary=File.Binary'takefrom:cameother:many:onsuch`:::'^is:each
End If
If File.Size>0 Then
File.SaveAs Server.Mappath(FilePath & FileName):AddData File.Name,OldFileName,FileName,FilePath,File.Size,File.ContentType,FileType,FileToBinary,FileExt,File.ImageWidth,File.ImageHeight:Count=Count + 1:CountSize=CountSize + File.Size
End If:Next:For Each Item in UploadObj.Form
If UploadForms.Exists (Item) Then UploadForms(Item)=UploadForms(Item) & ", " & Item.Value Else UploadForms.Add Item.Name , Item.Value
Next'likehavestillthese:gothesaid:theseanotheron:beingthemonlydo:[
If Not IsEmpty(SessionName) Then Session(SessionName)=Empty
End If:End Sub:Private Sub SaveFile_2():Dim FormName,Item,File,FormNames:Dim FileExt,OldFileName,FileName,FileType,FileToBinary :Dim Filesize:FileToBinary=Null
If Not IsEmpty(SessionName) Then
If Session(SessionName) <> UploadObj.Form(SessionName) or Session(SessionName)=Empty Then
ErrCodes=7:Exit Sub
End If'{_about:::most::'='"might:thatcould"'
End If:For Each FormName In UploadObj.Form:FormNames=""
If IsObject(UploadObj.Form(FormName)) Then
If Not UploadObj.Form(FormName).IsEmpty Then
UploadObj.Form(FormName).Maxbytes=FileMaxSize :UploadObj.OverWriteFiles=False:Filesize=UploadObj.Form(FormName).TotalBytes
If Err.Number<>0 Then
ErrCodes=-1:Response.Write "错误信息: " & Err.Description:EXIT SUB'his"'comenow:|:thisafterthansome;:]::if:
End If
If Filesize>FileMaxSize then
ErrCodes=4:Exit sub
End If:FileName=UploadObj.Form(FormName).ShortFileName :FileExt=Mid(Filename, InStrRev(Filename, ".")+1):FileExt=FixName(FileExt)
If CheckFileExt(FileExt)=False then
ErrCodes=5:EXIT SUB':'havecould:?theremustifthen"been~intothan*"orsame
End If:OldFileName=FileName:FileName=FormatName(OldFileName,FileExt):FileType=CheckFiletype(FileExt)
If Filesize>0 Then
UploadObj.Form(FormName).SaveAs Server.MapPath(FilePath & FileName):AddData FormName,OldFileName,FileName,FilePath,FileSize,UploadObj.Form(FormName).ContentType,FileType,FileToBinary,FileExt,-1,-1:Count=Count + 1:CountSize=CountSize + Filesize
End If
Else:ErrCodes=3:EXIT SUB
End If'allsince#:thenbecauseinishimselfmy"(and:''fromhowme
Else
If UploadObj.FormEx(FormName).Count > 1 Then
For Each FormNames In UploadObj.FormEx(FormName):FormNames=FormNames & ", " & FormNames:Next:UploadForms.Add FormName , FormNames
Else:UploadForms.Add FormName , UploadObj.Form(FormName)
End If
End If:Next'can:):theirbothdo:beinghadthesaidaremuch""never:
If Not IsEmpty(SessionName) Then Session(SessionName)=Empty
End Sub:Private Sub SaveFile_3():Dim FormName,Item,File:Dim FileExt,OldFileName,FileName,FileType,FileToBinary :UploadObj.InceptFileType=InceptFile:UploadObj.MaxSize=FileMaxSize:UploadObj.Install:FileToBinary=Null
If Not IsEmpty(SessionName) Then
If Session(SessionName) <> UploadObj.Form(SessionName) or Session(SessionName)=Empty Then
ErrCodes=7:Exit Sub
End If'like:into:as:atmakefor#has:must%::"butsee
End If
If UploadObj.Err > 0 then
Select Case UploadObj.Err:Case 1 : ErrCodes=3:Case 2 : ErrCodes=4:Case 3 : ErrCodes=5:Case 4 : ErrCodes=5:Case 5 : ErrCodes=-1:End Select:Exit Sub
Else:For Each FormName In UploadObj.File 
If Count>MaxFile Then
ErrCodes=6:Exit Sub':::herbut::nowthem'/"samemoremuchmakeoutbeforehere
End If:Set File=UploadObj.File(FormName):FileExt=FixName(File.FileExt)
If CheckFileExt(FileExt)=False then
ErrCodes=5:EXIT SUB
End If:OldFileName=File.FileName:FileName=FormatName(OldFileName,FileExt):FileType=CheckFiletype(FileExt)
If IsBinary Then
FileToBinary=File.FileData'or:hadgettheymeofgot:him""stillhe:sincehow!:
End If
If File.FileSize>0 Then
UploadObj.SaveToFile Server.mappath(FilePath & FileName),FormName:AddData FormName,OldFileName,FileName,FilePath,File.FileSize,File.FileType,FileType,FileToBinary,FileExt,File.FileWidth,File.FileHeight:Count=Count + 1:CountSize=CountSize + File.FileSize
End If:Set File=Nothing:Next:For Each Item in UploadObj.Form:UploadForms.Add Item.Name , Item.Value:Next
If Not IsEmpty(SessionName) Then Session(SessionName)=Empty
End If:End Sub:Private Sub AddData( Form_Name,OldFile_Name,File_Name,File_Path,File_Size,File_ContentType,File_Type,File_Data,File_Ext,File_Width,File_Height ):Set FileInfo=New FileInfo_Cls:FileInfo.FormName=Form_Name:FileInfo.OldFileName=OldFile_Name :FileInfo.FileName=File_Name:FileInfo.FilePath=File_Path:FileInfo.FileSize=File_Size:FileInfo.FileType=File_Type:FileInfo.FileContentType=File_ContentType:FileInfo.FileExt=File_Ext:FileInfo.FileData=File_Data:FileInfo.FileHeight=File_Height:FileInfo.FileWidth=File_Width:UploadFiles.Add Form_Name , FileInfo:Set FileInfo=Nothing:End Sub:Public Sub CreateView(Imagename,TempFilename,FileExt)'ourotherbycame:"any:":anout:overneverhere:@{
If ErrCodes <>0 Then Exit Sub
Select Case Preview_Type:Case 0:Image_Obj_0 Imagename,TempFilename,FileExt:Case 1:Image_Obj_1 Imagename,TempFilename,FileExt:Case 2:Image_Obj_2 Imagename,TempFilename,FileExt:Case Else:Preview_Type=999:End Select:End Sub:Sub Image_Obj_0(Imagename,TempFilename,FileExt):ImageObj.SetSavePreviewImagePath=Server.MapPath(TempFilename) :ImageObj.SetPreviewImageSize=SetPreviewImageSize :ImageObj.SetImageFile=Trim(Server.MapPath(Imagename)) 
If ImageObj.DoImageProcess=False Then
ErrCodes=-1:Response.Write "生成预览图错误: " & ImageObj.GetErrString
End If:End Sub:Sub Image_Obj_1(Imagename,TempFilename,FileExt):Dim Draw_X,Draw_Y,Logobox:Draw_X=0:Draw_Y=0:FileExt=Lcase(FileExt):ImageObj.Open Trim(Server.MapPath(Imagename))
If ImageObj.OriginalWidth<View_ImageWidth or ImageObj.Originalheight<View_ImageHeight Then':';'bothtakethe'&be%for:an:"didmorebetween
TempFilename="":Exit Sub
Else
If FileExt<>"gif" and ImageObj.OriginalWidth > Draw_ImageWidth * 2 and Draw_Type >0 Then
Draw_X=DrawImage_X(ImageObj.OriginalWidth,Draw_ImageWidth,2):Draw_Y=DrawImage_y(ImageObj.Originalheight,Draw_ImageHeight,2)
If Draw_Type=2 Then
Set Logobox=Server.CreateObject("Persits.Jpeg")':::::shoulditshould\@himself:::~.:can^
If err Then showerr(4010)
Logobox.Open Server.MapPath(Draw_Info):Logobox.Width=Draw_ImageWidth :Logobox.Height=Draw_ImageHeight :ImageObj.DrawImage Draw_X, Draw_Y, Logobox, Draw_Graph,Transition_Color,90 :ImageObj.Save Server.MapPath(Imagename):Set Logobox=Nothing
Else:ImageObj.Canvas.Font.Color=Draw_FontColor :ImageObj.Canvas.Font.Family=Draw_FontFamily :ImageObj.Canvas.Font.Bold=Draw_FontBold:ImageObj.Canvas.Font.Size=Draw_FontSize :ImageObj.Canvas.Print Draw_X, Draw_Y, Draw_Info :ImageObj.Canvas.Pen.Color=&H000000 :ImageObj.Canvas.Pen.Width=1 :ImageObj.Canvas.Brush.Solid=False :ImageObj.Save Server.MapPath(Imagename)
End If
End If
If ImageObj.Width > ImageObj.height Then':$+::"all::takefrom:cameother:many:onsuch
ImageObj.Width=View_ImageWidth:ImageObj.Height=ViewImage_Height(ImageObj.OriginalWidth,ImageObj.Originalheight,View_ImageWidth,View_ImageHeight)
Else:ImageObj.Width=ViewImage_Width(ImageObj.OriginalWidth,ImageObj.Originalheight,View_ImageWidth,View_ImageHeight):ImageObj.Height=View_ImageHeight
End If:ImageObj.Sharpen 1, 120:ImageObj.Save Server.MapPath(TempFilename) 
End If:End Sub:Public Sub Image_Obj_2(Imagename,TempFilename,FileExt):Dim Draw_X,Draw_Y:FileExt=Lcase(FileExt):Draw_X=0:Draw_Y=0:ImageObj.LoadImage Trim(Server.MapPath(Imagename))
If ImageObj.ErrorDescription <> "" Then
TempFilename="":ErrCodes=-1:Response.Write "生成预览图错误: " &ImageObj.ErrorDescription:Exit Sub'`:::'^is:eachlikehavestillthese:gothesaid:these
End If
If ImageObj.Width<Cint(View_ImageWidth) or ImageObj.Height<Cint(View_ImageHeight) Then
TempFilename="":Exit Sub
Else
IF FileExt<>"gif" and ImageObj.Width > Draw_ImageWidth * 2 and Draw_Type>0 Then
Draw_X=DrawImage_X(ImageObj.Width,Draw_ImageWidth,2):Draw_Y=DrawImage_y(ImageObj.Height,Draw_ImageHeight,2):Dim saiTopMiddle:Select Case Draw_XYType:Case "0" :saiTopMiddle=3:Case "1" :saiTopMiddle=5:Case "2" :saiTopMiddle=1:Case "3" :saiTopMiddle=6:Case "4" :saiTopMiddle=8:Case Else :saiTopMiddle=0:End Select'anotheron:beingthemonlydo:[{_about:::most::'
If Draw_Type=2 Then
ImageObj.AddWatermark Server.MapPath(Draw_Info), saiTopMiddle, Draw_Graph,Transition_Color,True
Else:ImageObj.Font.Italic=False :ImageObj.Font.height=Draw_FontSize:ImageObj.Font.name=Draw_FontFamily:ImageObj.Font.Color=Draw_FontColor:ImageObj.Text=Draw_Info:ImageObj.DrawTextOnImage Draw_X, Draw_Y, ImageObj.TextWidth, ImageObj.TextHeight
End If:ImageObj.SaveImage 0, ImageObj.ImageFormat, Server.MapPath(Imagename)
End If:ImageObj.ColorResolution=24 :ImageObj.ResizeImage View_ImageWidth,View_ImageHeight,0,0:ImageObj.SaveImage 0, 3, Server.MapPath(TempFilename)
End If:End Sub:Private Function ViewImage_Width(Image_W,Image_H,xView_W,xView_H)'='"might:thatcould"'his"'comenow:|:thisafter
If Draw_SizeType="1" Then
ViewImage_Width=Image_W * xView_H / Image_H
Else:ViewImage_Width=xView_W
End If:End Function:Private Function ViewImage_Height(Image_W,Image_H,xView_W,xView_H)
If Draw_SizeType="1" Then
ViewImage_Height=xView_W * Image_H / Image_W'thansome;:]::if::'havecould:?theremustifthen
Else:ViewImage_Height=xView_H
End If:End Function:Private Function DrawImage_X(xImage_W,xLogo_W,SpaceVal):Select Case Draw_XYType:Case "0" :DrawImage_X=SpaceVal:Case "1" :DrawImage_X=SpaceVal:Case "2" :DrawImage_X=(xImage_W - xLogo_W) / 2:Case "3" :DrawImage_X=xImage_W - xLogo_W - SpaceVal:Case "4" :DrawImage_X=xImage_W - xLogo_W - SpaceVal:Case Else :DrawImage_X=0:End Select:End Function:Private Function DrawImage_Y(yImage_H,yLogo_H,SpaceVal):Select Case Draw_XYType:Case "0" :DrawImage_Y=SpaceVal:Case "1" :DrawImage_Y=yImage_H - yLogo_H - SpaceVal:Case "2" :DrawImage_Y=(yImage_H - yLogo_H) / 2:Case "3" :DrawImage_Y=SpaceVal:Case "4" :DrawImage_Y=yImage_H - yLogo_H - SpaceVal:Case Else :DrawImage_Y=0:End Select:End Function:End Class:Class FileInfo_Cls:Public FormName,OldFileName,FileName,FilePath,FileSize,FileContentType,FileType,FileData,FileExt,FileWidth,FileHeight:Private Sub Class_Initialize:FileWidth=-1:FileHeight=-1:End Sub:End Class:Class UpFile_Class:Public Form,File,Version,Err:Private CHK_FileType,CHK_MaxSize:Private Sub Class_Initialize:Version="无惧上传类 Version V1.0":Err=-1:CHK_FileType="":CHK_MaxSize=-1:Set Form=Server.CreateObject ("Scripting.Dictionary"):Set File=Server.CreateObject ("Scripting.Dictionary"):Set oUpFileStream=Server.CreateObject (streamname):Form.CompareMode=1:File.CompareMode=1:oUpFileStream.Type=1:oUpFileStream.Mode=3:oUpFileStream.Open:End Sub:Private Sub Class_Terminate:Form.RemoveAll:Set Form=Nothing:File.RemoveAll:Set File=Nothing:oUpFileStream.Close:Set oUpFileStream=Nothing:End Sub:Public Property Get InceptFileType:InceptFileType=CHK_FileType:End Property:Public Property Let InceptFileType(Byval vType):CHK_FileType=vType:End Property:Public Property Get MaxSize:MaxSize=CHK_MaxSize:End Property:Public Property Let MaxSize(vSize)
If IsNumeric(vSize) Then CHK_MaxSize=Int(vSize)
End Property:Public Sub GetDate():Dim RequestBinDate,sSpace,bCrLf,sInfo,iInfoEnd,tStream,iStart,oFileInfo:Dim sFormValue,sFileName,sFormName,RequestSize:Dim iFindStart,iFindEnd,iFormStart,iFormEnd,FileBlag:RequestSize=Request.TotalBytes
if Not IsNumeric(RequestSize) then RequestSize=0
RequestSize=Int(RequestSize)'"been~intothan*"orsameallsince#:thenbecauseinishimselfmy
If RequestSize < 1 Then
Err=1:Exit Sub
End If:Set tStream=Server.CreateObject (streamname):oUpFileStream.Write Request.BinaryRead (RequestSize):oUpFileStream.Position=0:RequestBinDate=oUpFileStream.Read
iFormEnd=oUpFileStream.Size:bCrLf=ChrB (13) & ChrB (10):sSpace=MidB (RequestBinDate,1, InStrB (1,RequestBinDate,bCrLf)-1):iStart=LenB (sSpace)
iFormStart=iStart+2:Do:iInfoEnd=InStrB (iFormStart,RequestBinDate,bCrLf & bCrLf)+3:tStream.Type=1:tStream.Mode=3:tStream.Open:oUpFileStream.Position=iFormStart:oUpFileStream.CopyTo tStream,iInfoEnd-iFormStart:tStream.Position=0:tStream.Type=2:tStream.CharSet="utf-8":sInfo=tStream.ReadText
iFormStart=InStrB (iInfoEnd,RequestBinDate,sSpace)-1'"(and:''fromhowmecan:):theirbothdo:beinghad
iFindStart=InStr(22,sInfo,"name=""",1)+6
iFindEnd=InStr(iFindStart,sInfo,"""",1):sFormName=Mid(sinfo,iFindStart,iFindEnd-iFindStart)
If InStr(45,sInfo,"filename=""",1) > 0 Then
Set oFileInfo=new FileInfo_Class
iFindStart=InStr(iFindEnd,sInfo,"filename=""",1)+10
iFindEnd=InStr(iFindStart,sInfo,"""",1):sFileName=Mid(sinfo,iFindStart,iFindEnd-iFindStart):oFileInfo.FileName=Mid(sFileName,InStrRev(sFileName, "\")+1):oFileInfo.FilePath=Left(sFileName,InStrRev(sFileName, "\")):oFileInfo.FileExt=Lcase(Mid(sFileName,InStrRev(sFileName, ".")+1))'thesaidaremuch""never:like:into:as:atmakefor#
iFindStart=InStr (iFindEnd,sInfo,"Content-Type: ",1)+14
iFindEnd=InStr (iFindStart,sInfo,vbCr):oFileInfo.FileType=Ucase(Mid(sinfo,iFindStart,iFindEnd-iFindStart)):oFileInfo.FileStart=iInfoEnd:oFileInfo.FileSize=iFormStart -iInfoEnd -2:oFileInfo.FormName=sFormName
If Instr(oFileInfo.FileType,"IMAGE/") Or Instr(oFileInfo.FileType,"FLASH") Then
FileBlag=GetImageSize:oFileInfo.FileExt=FileBlag(0):oFileInfo.FileWidth=FileBlag(1):oFileInfo.FileHeight=FileBlag(2):FileBlag=Empty
End If
If CHK_MaxSize > 0 Then'has:must%::"butsee:::herbut::nowthem'
If oFileInfo.FileSize > CHK_MaxSize Then
Err=2:Exit Sub
End If
End If
If CheckErr(oFileInfo.FileExt)=False Then
Exit Sub'/"samemoremuchmakeoutbeforehereor:hadgettheymeofgot:him
End If:File.Add sFormName,oFileInfo
Else:tStream.Close:tStream.Type=1:tStream.Mode=3:tStream.Open:oUpFileStream.Position=iInfoEnd:oUpFileStream.CopyTo tStream,iFormStart-iInfoEnd-2:tStream.Position=0:tStream.Type=2:tStream.CharSet="utf-8":sFormValue=tStream.ReadText
If Form.Exists (sFormName) Then Form (sFormName)=Form (sFormName) & ", " & sFormValue Else Form.Add sFormName,sFormValue
End If:tStream.Close
iFormStart=iFormStart+iStart+2:Loop Until (iFormStart+2)=iFormEnd:RequestBinDate="":Set tStream=Nothing:End Sub:Private Function CheckErr(Byval ChkExt):CheckErr=False
If CHK_FileType="" Then CheckErr=True : Exit Function'""stillhe:sincehow!:ourotherbycame:"any:":
Dim ChkStr:ChkStr=","&Lcase(CHK_FileType)&","
If Instr(ChkStr,","&ChkExt&",")>0 Then
CheckErr=True
Else:Err=3
End If:End Function:Private Function Bin2Str(Byval Bin):Dim i, Str, Sclow:For i=1 To LenB(Bin):Sclow=MidB(Bin,i,1)
If ASCB(Sclow)<128 Then'anout:overneverhere:@{:';'bothtakethe'&be
Str=Str & Chr(ASCB(Sclow))
Else:i=i+1
If i <=LenB(Bin) Then Str=Str & Chr(ASCW(MidB(Bin,i,1)&Sclow))
End If:Next:Bin2Str=Str:End Function:Private Function Num2Str(Byval num,Byval Base,Byval Lens):Dim ImageSize:ImageSize="":While(num>=Base):ImageSize=(num mod Base) & ImageSize:num=(num - num mod Base)/Base:Wend:Num2Str=Right(String(Lens,"0") & num & ImageSize,Lens):End Function:Private Function Str2Num(Byval str,Byval Base):Dim ImageSize,i:ImageSize=0:For i=1 To Len(str):ImageSize=ImageSize *Base + Cint(Mid(str,i,1)):Next:Str2Num=ImageSize:End Function:Private Function BinVal(Byval bin):Dim ImageSize,i:ImageSize=0:For i=lenb(bin) To 1 Step -1:ImageSize=ImageSize *256 + ASCB(Midb(bin,i,1)):Next:BinVal=ImageSize:End Function:Private Function BinVal2(Byval bin):Dim ImageSize,i:ImageSize=0:For i=1 To Lenb(bin):ImageSize=ImageSize *256 + ASCB(Midb(bin,i,1)):Next:BinVal2=ImageSize:End Function:Private Function GetImageSize():Dim ImageSize(2),bFlag:bFlag=oUpFileStream.Read(3):Select Case Hex(BinVal(bFlag)):Case "4E5089"::oUpFileStream.Read(15):ImageSize(0)="png":ImageSize(1)=BinVal2(oUpFileStream.Read(2)):oUpFileStream.Read(2):ImageSize(2)=BinVal2(oUpFileStream.Read(2)):Case "464947"::oUpFileStream.Read(3):ImageSize(0)="gif":ImageSize(1)=BinVal(oUpFileStream.Read(2)):ImageSize(2)=BinVal(oUpFileStream.Read(2)):Case "535746"::Dim BinData,sConv,nBits:oUpFileStream.Read(5):BinData=oUpFileStream.Read(1):sConv=Num2Str(ASCB(BinData),2 ,8):nBits=Str2Num(Left(sConv,5),2):sConv=Mid(sConv,6):While(Len(sConv)<nBits*4):BinData=oUpFileStream.Read(1):sConv=sConv&Num2Str(ASCB(BinData),2 ,8):Wend:ImageSize(0)="swf":ImageSize(1)=Int(ABS(Str2Num(Mid(sConv,1*nBits+1,nBits),2)-Str2Num(Mid(sConv,0*nBits+1,nBits),2))/20):ImageSize(2)=Int(ABS(Str2Num(Mid(sConv,3*nBits+1,nBits),2)-Str2Num(Mid(sConv,2*nBits+1,nBits),2))/20):Case "535743"::ImageSize(0)="swf":ImageSize(1)=0:ImageSize(2)=0:Case "FFD8FF"::Dim p1:Do:Do: p1=BinVal(oUpFileStream.Read(1)): Loop While p1=255 And Not oUpFileStream.EOS
If p1>191 and p1<196 Then Exit Do Else oUpFileStream.Read(BinVal2(oUpFileStream.Read(2))-2)
Do:p1=BinVal(oUpFileStream.Read(1)):Loop While p1<255 And Not oUpFileStream.EOS:Loop While True:oUpFileStream.Read(3):ImageSize(0)="jpg":ImageSize(2)=BinVal2(oUpFileStream.Read(2)):ImageSize(1)=BinVal2(oUpFileStream.Read(2)):Case Else:'%for:an:"didmorebetween:::::shoulditshould\@
If Left(Bin2Str(bFlag),2)="BM" Then
oUpFileStream.Read(15):ImageSize(0)="bmp":ImageSize(1)=BinVal(oUpFileStream.Read(4)):ImageSize(2)=BinVal(oUpFileStream.Read(4))
Else:ImageSize(0)="(UNKNOWN)"
End If:End Select:GetImagesize=ImageSize:End Function:End Class:Class FileInfo_Class:Public FormName,FileName,FilePath,FileSize,FileType,FileStart,FileExt,FileWidth,FileHeight:Private Sub Class_Initialize:FileWidth=0:FileHeight=0:End Sub:Public Sub SaveToFile (Byval Path):Dim Ext,oFileStream:Ext=LCase(Mid(Path, InStrRev(Path, ".") + 1))
If Ext <> FileExt Then Exit Sub
If Trim(Path)="" or FileStart=0 or FileName="" or Right(Path,1)="/" Then Exit Sub'himself:::~.:can^:$+::"all::take
Set oFileStream=CreateObject (streamname):oFileStream.Type=1:oFileStream.Mode=3:oFileStream.Open:oUpFileStream.Position=FileStart:oUpFileStream.CopyTo oFileStream,FileSize:oFileStream.SaveToFile Path,2:oFileStream.Close:Set oFileStream=Nothing:End Sub:Public Function FileData:oUpFileStream.Position=FileStart:FileData=oUpFileStream.Read (FileSize):End Function:End Class
%>
