<% if UserLogined<>True then Response.Redirect "do.asp?ac=login&refer="&GetUrl Response.End end if action=SafeRequest("action","get") on error resume next Server.ScriptTimeout = 9999999 Dim Upload,successful,thisFile,upPath,path Dim CmsDjPic,CmsDjUser Set CmsDjPic = New CmsDj_Com_Pic Set CmsDjUser = New CmsDj_Com_User set Upload=new AnUpLoad Upload.openProcesser=true '打开进度条显示 Upload.SingleSize=CD_UploadSize*1024*1024 '设置单个文件最大上传限制,按字节计;默认为不限制,本例为512M Upload.MaxSize=CD_UploadSize*1024*1024 '设置最大上传限制,按字节计;默认为不限制,本例为1G If action="headpic" or action="pic" Then Upload.Exe=CD_UploadTypeA '设置允许上传的扩展名 If action="url" Then Upload.Exe=CD_UploadTypeB '设置允许上传的扩展名 Upload.GetData() if Upload.ErrorID>0 then upload.setApp "faild",1,0 ,Upload.description else if Upload.files(-1).count>0 then 'upPath=request.querystring("path") 'path=server.mappath(upPath) 'set tempCls=Upload.files("file1") 'upload.setApp "saving",Upload.TotalSize,Upload.TotalSize,tempCls.FileName If action="headpic" Then upPath="../../Upload/Headpic" ElseIf action="url" Then upPath="../../Upload/Url" ElseIf action="pic" Then upPath="../../Upload/Pic" End if path=server.mappath(upPath) set tempCls=Upload.files("file1") upload.setApp "saving",Upload.TotalSize,Upload.TotalSize,tempCls.FileName If action="headpic" Then successful=tempCls.SaveToFile(path,2) Arr1=Array("UserPhoto") Arr2=Array("upload/headpic/"&CmsDj_Com_UserID&".gif") Call CmsDjUser.update(Arr1,Arr2,"UserID="&CmsDj_Com_UserID) Conn.DB "insert into CmsDj_Upload(webtype,filename,UserName,totable,uploadtime,url) values('头像','"&CmsDj_Com_UserID&".gif','"&CmsDj_Com_UserName&"','"&tempCls.Size&"','"&Now()&"','upload/headpic/"&CmsDj_Com_UserID&".gif')","exe" ElseIf action="pic" Then successful=tempCls.SaveToFile(path,0) Conn.DB "insert into CmsDj_Upload(webtype,filename,UserName,totable,uploadtime,url) values('照片','"&tempCls.NewName&"','"&CmsDj_Com_UserName&"','"&tempCls.Size&"','"&Now()&"','upload/pic/"&tempCls.NewName&"')","exe" ElseIf action="url" Then successful=tempCls.SaveToFile(path,0) Conn.DB "insert into CmsDj_Upload(webtype,filename,UserName,totable,uploadtime,url) values('歌曲','"&tempCls.NewName&"','"&CmsDj_Com_UserName&"','"&tempCls.Size&"','"&Now()&"','upload/url/"&tempCls.NewName&"')","exe" End if thisFile="{name:'" & tempCls.FileName & "',size:" & tempCls.Size & ",LocalName:'" & tempCls.LocalName & "',NewName:'" & tempCls.NewName & "'}" allFiles=allFiles & thisFile & "," set tempCls=nothing upload.setApp "saved",Upload.TotalSize,Upload.TotalSize,left(allFiles,len(allFiles)-1) else upload.setApp "faild",1,0,"没有上传任何文件" end if end if if err then upload.setApp "faild",1,0,err.description set Upload=nothing response.end %>