📄 upphoto.asp
字号:
<%
'****************************************************
' 多多校园 Power by ddtaobao.com
' Email:ddmaster@126.com OICQ:136465584
' Web: http://www.ddtaobao.com 作者:多多
' 校园、企业、医院、公司程序定做,系统开发,网站制作!
' Copyright (C) 2007 ddtaobao.com All Rights Reserved
'****************************************************
%><!--#include file="conn.asp"-->
<!--#include file="inc/upload_inc.asp"-->
<SCRIPT language=JavaScript>
<!--
if(parent.location == location) location = "index.asp";;
// -->
</SCRIPT>
<%dim type1
type1=request("type1")
%>
<style type="text/css">
body, a, table, div, span, td, th, input, select{font:9pt;font-family: "宋体", Verdana, Arial, Helvetica, sans-serif;}
body {margin-left:0px;margin-top:0px;margin-bottom:0px;}
body, a, table, div, span, td, th, input, select{font:9pt;font-family: "宋体", Verdana, Arial, Helvetica, sans-serif;}
body {padding:0px}
A:link,A:active,A:visited{TEXT-DECORATION:none ;Color:#000000}
A:hover{TEXT-DECORATION: underline;Color:#000000}
</style>
<body>
<%if type1="" then%>
<form method="post" action="upphoto.asp?type1=save" enctype="multipart/form-data" name="form2" >
<input type=file name="sf_upfile" size="25" class=text style="border: 1px solid #000000; background-color: #FFFFFF; color:#000000" >
<input type="submit" value="上传" name="submit" style="border: 1px solid #000000; background-color: #FFFFFF" >
</form>
<%end if%>
<%if type1="save" then%>
<%
upfile="UploadFiles/"
set upload=new upload_5xsoft
set file=upload.file("sf_upfile")
if file.fileSize<1 then
response.write"<script language=javascript>alert('您没有选择图片。~~~\n\n-----请点击浏览按钮,从弹出的窗口中选择要上传的图片。\n\n-----然后点击上传按钮就可以把图片上传了...\n\n-----不过要注意图片的格式哦~~~');history.back()</script>"
response.end
end if
if file.fileSize<10 or file.fileSize>1000*1024 then
response.write "错误:上传的图片大小超过了限制! <a href='javascript:history.go(-1)'>退回上一步</a>"
response.end
end if
upfilename = split(file.FileName,".")
upfileext = upfilename(ubound(upfilename))
if upfileext<>"jpg" and upfileext<>"jpeg" and upfileext<>"gif" and upfileext<>"JPG" and upfileext<>"JPEG" and upfileext<>"GIF"then
response.write "错误:上传的文件格式不对! <a href='javascript:history.go(-1)'>退回上一步</a>"
response.end
end if
ufp=""&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&upfilename(ubound(upfilename))
file.saveas Server.mappath("UploadFiles/"&ufp)
response.write "<script>parent.document.formadd.pic.value='"&"UploadFiles/"&ufp&"'</script>"
set rs=nothing
%>
<font color="#FF0000">[图片上传成功] </font>
<a href="upphoto.asp">重新上传</a>
<%
set file=nothing
set upload=nothing
'set my_conn = nothing
'set rs = nothing
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -