📄 upfilehfwz.asp
字号:
<%
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Response.Write("对不起,您不是社区用户,请先注册!")
Response.End
end if
%>
<%
if Request("menu")="up" then
On Error Resume Next
Set upl = Server.CreateObject("SoftArtisans.FileUp")
If -2147221005 = Err Then
error2("本服务器不支持 SoftArtisans.FileUp 组件!")
End If
filename=""&year(date)&""&month(date)&""&day(date)&""&hour(time)&""&minute(time)&""&second(time)&""
select case ""&upl.ContentType&""
case "application/octet-stream"
error2("未知文件格式")
case "image/gif"
types="gif"
case "image/pjpeg"
types="jpg"
case "text/html"
types="htm"
case "text/plain"
types="txt"
case "application/msword"
types="doc"
case "application/x-zip-compressed"
types="zip"
case "application/x-shockwave-flash"
types="swf"
end select
if upl.TotalBytes > 102400 then
error2("文件大小不得超过 100 K\n当前的文件大小为 "&int(upl.TotalBytes/1024)&" K")
end if
if ""&upl.TotalBytes&""=""&Request.Cookies("TotalBytes")&"" then
error2("请不要上传相同的文件!")
end if
if types="gif" or types="jpg" then
img="[图像]upfile/"&filename&"."&types&"[/图像]"
elseif types="swf" then
img="[动画]upfile/"&filename&"."&types&"[/动画][超级链接=upfile/"&filename&"."&types&"]下载此FLASH动画[/超级链接]"
elseif types="rar" or types="zip" then
img="[图像]images/affix.gif[/图像][超级链接=upfile/"&filename&"."&types&"]本帖相关附件[/超级链接]"
else
error2("对不起,本服务器只支持GIF、JPG、HTM、RAR、DOC、ZIP、SWF格式的文件\n不支持 "&upl.ContentType&" 格式的文件")
end if
upl.SaveAs Server.mappath("upfile/"&filename&"."&types&"")
Response.Cookies("TotalBytes")=""&upl.TotalBytes&""
set upl=nothing
response.write "<body bgcolor=#f7f7f7><SCRIPT>parent.fHFWZ.tWZNR.value+='\n"&img&"'</SCRIPT>"
response.write "<span style=font-size:9pt>若需要继续上传,请<a href=javascript:history.back()>返回继续</a></span>"
response.end
else
%>
<body topmargin=0 bgcolor=#f7f7f7>
<form enctype=multipart/form-data method=post action=?menu=up>
<table cellpadding=0 cellspacing=0 width=100%>
<tr><td><IMG src=images/affix.gif><font style=FONT-SIZE:9pt>增加附件(100K以内)</td>
<td align=right><input type=file style=FONT-SIZE:9pt name=f size="15"> <input style=FONT-SIZE:9pt type="submit" value=" 上 传 " name=Submit></td></tr></table>
<%
end if
%>
<%
sub error2(message)
%>
<script>alert('<%=message%>');history.back();</script><script>window.close();</script>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -