关于无组件上传类被认为是病毒的公告最近发现不少上传组件被认为是病毒而杀掉,具体表现为客户论坛名为upload.inc,upload_fun.asp的文件被认为是病毒文件而杀掉,具体原因是因为国内很多论坛程序使用了名为“无惧上传类”的一段通过ado.stream组件上传的代码。这段代码被不少安全机构认为是对于Web服务器有恶意威胁,自从五月起将其归类为backdoor.sinups恶意程序而查杀。具体安全公告请参阅爱喜千团网(网络技术,ASP技术,网管技术,CISCO技术,换物网,物物交换网,闲置物品交易网,网站编程技术,网络编程,.NET编程,程序员论坛,以物换物)所谓“无组件上传”,是指通过Windows服务器内建ADO.Stream对象实现的一种文件上传方式,一般用于客户的图片,文件等Web上传程序,相对于其他上传方式来说,无组件上传没有特殊的组件要求,但是其上传功能是继承自asp内部对象,上传功能不是非常稳定,对于asp脚本执行时间有较高要求,并对于上传大小有一定限制。因此,推荐客户使用我们提供的ASPUpload上传组件。使用aspupload可以使您站点的上传功能更为稳定,健壮。对于aspupload,目前使用中的绝大多数程序都可以支持,只需要将您的站点程序设置为使用aspupload上传功能即可。并请客户不要使用“无惧上传类”这段代码,以避免不必要的麻烦。请慎重处理好您站点程序的上传功能,以避免站点可能出现的安全隐患。下面送上ASPUpload上传的实现代码(测试通过):fileconfig.asp%DimUploadFilePath,UploadLimitSize,UploadfileAllowext,BrowerFilePathUploadFilePath=/upfile/&year(now)&_&month(now)&_&day(now)&/'文件上传路径BrowerFilePath=/upfile/UploadLimitSize=1024*50'50M'最大上传文件大小,单位为KUploadfileAllowext=.txt|.asp|.rar'可以上传的文件类型functionCanUpload(Fileurl)Fileurl=lcase(|&Mid(Fileurl,InstrRev(Fileurl,.)+1)&|)UploadfileAllowextstr=|&UploadfileAllowext&|ifinstr(UploadfileAllowextstr,Fileurl)0thenCanUpload=falseelseCanUpload=trueendifendfunctionFunctionCreateFolder(Filepath)Dimfso,fonerrorresumenextSetfso=CreateObject(Scripting.FileSystemObject)ifnotfso.FolderExists(Filepath)thenSetf=fso.CreateFolder(Filepath)setf=Nothingendifsetfso=NothingEndFunction%framebar.asp%@EnableSessionState=False%%Response.Expires=-1%title正在上传............/titlestyletype='text/css'td{font-family:Tahoma;font-size:8pt}/styleBODYBGCOLOR=menuscroll=NOframeborder=NOstatus=nostyle=border:0px;scriptlanguage=JavaScript!--functionStopupload(){if(typeof(window.opener)!=undefined){try{window.opener.document.execCommand(stop);}catch(e){}}elseif(typeof(window.dialogArguments)!=undefined){try{window.dialogArguments.document.execCommand(stop);}catch(e){}}window.close();}//--/scriptIFRAMEsrc=bar.asp?PID=%=Request(PID)&&to=&Request(to)%title=Uploadingnoresizescrolling=noframeborder=0framespacing=10width=369height=115/IFRAMETABLEBORDER=0WIDTH=100%cellpadding=2cellspacing=0TRTDALIGN=centerbuttononclick=Stopupload()style=font-size:12px;取消上传/button/TD/TR/TABLE/BODY/HTMLbar.asp%@EnableSessionState=False%%Response.Expires=-1PID=Request(PID)TimeO=Request(to)SetUploadProgress=Server.CreateObject(Persits.UploadProgress)format=brCENTERb正在上传,请耐心等待.../b/CENTERbr%T%t%B3%T速度:(%S/秒)估计剩余时间:%R%r%U/%V(%P)%l%tbar_content=UploadProgress.FormatProgress(PID,TimeO,#00007F,format)If=bar_contentThen%HTMLHEADTITLEUploadFinished/TITLESCRIPTLANGUAGE=JavaScriptfunctionCloseMe(){window.parent.close();returntrue;}/SCRIPT/HEADBODYOnLoad=CloseMe()BGCOLOR=menu/BODY/HTML%Else'Notfinishedyet%HTMLHEADmetaHTTP-EQUIV=RefreshCONTENT=1;URL=%Response.WriteRequest.ServerVariables(URL)Response.Write?to=&TimeO&&PID=&PID%TITLE正在上传文件.../TITLEstyletype=text/cssbody,td{font-family:Tahoma;font-size:8pt}td.spread{font-size:6pt;line-height:6pt}td.brick{font-size:6pt;height:12px}/style/HEADBODYBGCOLOR=menutopmargin=0%=bar_content%/BODY/HTML%EndIf%uploadfile.asp!--#includefile='fileconfig.asp'--!doctypehtmlpublic-//W3C//DTDHTML4.0Transitional//ENhtmlheadmetahttp-equiv=Content-Typecontent=text/html;charset=gb2312metaname=Keywordscontent=metaname=Authorcontent=haiwatitleUpload/titlestyle!--*{font:12px;}--/style/headbody%OnErrorResumeNextServer.ScriptTimeOut=999999ifrequest(act)=uploadthendimfolder,savepathsavepath=Server.MapPath(UploadFilePath)CreateFolder(savepath)SetUpload=Server.CreateObject(Persits.Upload)Upload.SetMaxSizeUploadLimitSize*1024,TrueUpload.OverwriteFiles=falseifRequest.QueryString(PID)=thenUpload.ProgressID=010D60EB00C5AA4BelseUpload.ProgressID=Request.QueryString(PID)endifCount=Upload.Save(savepath)IfErr.Number0ThenResponse.Writedivstyle=color:red;font-size:12px;出现错误:&Err.Number&、&Err.Description&ahref=javascript:history.go(-1)重新上传/a/divEndIfIfErr.Number=8ThenResponse.Writedivstyle=color:red;font-size:12px;你上传的文件超过限制(&UploadLimitSize/1024&M)ahref=javascript:history.go(-1)重新上传/a/divresponse.endendifdiminputnamedimsize,rs_upfileForEachFileinUpload.FilesifnotCanUpload(File.ext)thenFile.Deleteresponse.writedivstyle=color:red;font-size:12px;&file.filename&(&file.size&)格式不正确!ahref=javascript:history.go(-1)重新上传/a/divelseresponse.writedivstyle=color:green;font-size:12px;!--&file.filename&(&file.size&)--上传成功%ahref=javascript:history.go(-1)重新上传/a/div%endifnextelse%%dimSPid,PID,barrefSetUploadProgress=Server.CreateObject(Persits.UploadProgress)SPid=UploadProgress.CreateProgressID()PID=PID=&SPidbarref=framebar.asp?to=10&&PID%SCRIPTLANGUAGE=JavaScriptfunctionShowProgress(){strAppVersion=navigator.appVersion;if(document.MyForm.FILE1.value!=){if(strAppVersion.indexOf('MSIE')!=-1&&strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1)4){winstyle=dialogWidth=375px;dialogHeight:175px;center:yes;s