<%
dim flname
dim dirname
dirname="codeupload"&year(now())&month(now())&day(now())
function checkfile(filename,filesize,extname)
if filesize>5210000 then
response.write "<p align=center>你上传的源码太大,上传源码的大小应该小于5M!</p>"
checkfile=false
exit function
end if
if filesize=-1 then
response.write "<p align=center>你要上传的文件找不到,请确认文件路径是否正确?</p>"
checkfile=false
exit function
end if
if extname<>".zip" and extname<>".rar" then
response.write "<p aling=center>源码只能以.zip或.rar形式上传</p>"
checkfile=false
exit function
end if
flname=trim(session("username"))&year(now())&month(now())&day(now())&hour(now())&minute(now())&second(now())&extname
fileobj.FilePath=Server.MapPath("/") & "/upload/"&dirname
FileObj.SaveFile "filename",flname
'response.write fileObj.FilePath&flname
set filesize=nothing
set extname=nothing
checkfile=true
end function
'response.write filename & "--"
if trim(Request.QueryString("add"))="1" then
Set FileObj=Server.CreateObject("iNotes.UpLoad")
filename=FileObj.FileName ("filename")
extname=FileObj.ExtName("filename")
filesize=fileobj.filesize("filename")
if checkfile(filename,filesize,extname)=false then
response.write "<a href=javascript:history.go(-1);>返回</a>"
set picname=nothing
set content=nothing
set filename=nothing
set filesize=nothing
set extname=nothing
response.end
else
picpath="http://"&Request.ServerVariables ("HTTP_HOST")&"/upload/"&dirname&"/"&flname
Response.Write "<tr><td bgcolor="&table_title_color&" align='center'>上传源码成功,请按以下地址制作你的下载链接,谢谢:<br>"&picpath&"</td></tr>"
end if