www.gusucode.com > 维六酷博客管理系统 1.1源码程序 > master/upmyphoto.asp
<!--#include file="check.asp"--> <!--#include file="UPLOAD.asp"--> <!-- #include file="../inc/function.asp" --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> 上传我的相片 </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> <% Server.ScriptTimeOut=86400 set upload=new upload_5xSoft ''建立上传对象 set file=upload.file("file") '限制文件格式 fileExt=getExt(file.filename) Forum_upload="gif,jpg,jpeg" Forumupload=split(Forum_upload,",") for i=0 to ubound(Forumupload) if fileEXT=trim(Forumupload(i)) then uploadsuc=true exit for else uploadsuc=false end if Next if uploadsuc=false then response.write "<font size=2>文件格式受限制[<a href=# onclick=history.go(-1)>请重新上传</a>]</font>" response.end end If ''''''''''''''' if file.filesize>0 then if file.filesize>1024*500 Then '限制上传的文件大小 response.write "<font size=2>文件大小超过了限制[<a href=# onclick=history.go(-1)>重新上传</a>]</font>" response.end end If uploadsuc=false end if filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&file.FileName if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据 file.SaveAs Server.mappath("../upfile/myphoto.jpg") ''保存文件 'Call MessageBox("上传相片成功!","myinfo.asp") Response.write("<script>alert(""上传成功"");</script><meta http-equiv=""refresh""content=""0;url=myinfo.asp""> ") end if %> </BODY> </HTML>