www.gusucode.com > 山寨版广告信息招贴网源码程序 > 山寨版广告信息招贴网源码程序/ewuyi/dir_发布/user/uploadad.asp

    <%if instr(request.ServerVariables("HTTP_REFERER"),request.ServerVariables("SERVER_NAME"))=0 then 
Response.Redirect "/index.asp"
response.End 
end if%>
<!--#include FILE="upload_inc.asp"-->
<%Server.ScriptTimeOut=5000%>
<html>
<head>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
'on error resume next
set upload=new upload_5xsoft
set file=upload.file("st_upfile")
if file.fileSize<1 or file.fileSize>100000 then
	response.write "<script language=""javascript"">parent.frnews.submit()</script><font size=2>错误:上传的图片大小超过了限制! <a href='javascript:history.go(-1)'><b>退回上一步</b></a></font>"
	response.end
end if
upfilename = split(file.FileName,".")
upfileext = upfilename(ubound(upfilename))
if lcase(upfileext)<>"jpg" and lcase(upfileext)<>"gif" then
	response.write "<font size=2>错误:上传的文件格式不对! <a href='javascript:history.go(-1)'><b>退回上一步</b></a></font>"
	response.end
end if
ufp="/pic/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&timer()&"."&upfilename(ubound(upfilename))
file.saveas Server.mappath(""&ufp&"")
%>
<script >
parent.postart.upfile.value='<%=ufp%>'
location.replace('upload.asp?mode=doit&ufp=<%=ufp%>')
</script>
<%
set file=nothing
set upload=nothing
set my_conn = nothing
set rs = nothing
%>
</BODY></html>