📄 uploadindex.asp
字号:
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include FILE="ascendClass.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>upload</title>
<LINK href="images/style.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript>
function check()
{
var strFileName=document.form1.strFile1.value;
if (strFileName=="")
{
alert("请选择要上传的文件");
document.form1.strFile1.focus();
return false;
}
return true;
}
</SCRIPT>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
body,td,th {
font-size: 12px;
color: #FF0000;
}
a {
font-size: 12px;
color: #000000;
}
-->
</style></head>
<body class="a3">
<%
dim sortname,folder,formPath
formPath= "images/"
sortname=request("sort")
if sortname="" then
sortname="pic"
end if
folder=request("folder")
if folder<>"" then
formpath=formpath&folder&"/"
end if
up=request("up")
if up="up" then
%>
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
<%
dim request2
'建立上传对象
set request2=New UpLoadClass
'上传总大小为1000M
request2.TotalSize= 1048576000
'单文件最大500M
request2.MaxSize = 100288000
'允许上传rar/zip格式文件
request2.FileType = "rar/zip/mp3/doc/jpg/gif/xls/swf/bmp/png/pdf/exe/txt"
request2.SavePath=""&formPath
request2.open()
if request2.Error=-1 then
response.Write("请选则文件!")
elseif request2.Error=4 then
response.Write("总数据量超过限制,上传失败")
elseif request2.Error=1 then
response.Write "文件大小超过限制,允许最大文件为"&request2.MaxSize&"k"
elseif request2.Error=2 then
response.Write "文件格式不对!"
else
response.Write "<SCRIPT>parent.myform."&sortname&".value+='"&replace(request2.SavePath,"../","")&request2.Form("strFile1")&"'</SCRIPT>"
response.Write("上传成功!")
end if
'释放上传对象
set request2=nothing
%>
</td></tr></table>
<%
up=""
response.End()
end if
%>
<form action="?up=up&sort=<%=sortname%>&folder=<%=folder%>" enctype="multipart/form-data" name="form1" method="post" onSubmit="return check()">
<table border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td>
<input name="strFile1" type="file" id="strFile1" class="paixu">
<input type="submit" name="Submit" value="上传" class="btn">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -