上传asp文件上传源代码

asp 文件上传  时间:2021-02-09  阅读:()

<html>

<head>

<t it l e>化境上传</t it le>

<META http-equiv=Co ntent-Type content="text/html; chars et=gb 2312"><LIN Khref="inc/adminstyle.css"type=text/css rel=StyleSheet>

<META content="Micros o ft F rontP age 6.0"name=GENERATOR>

<style typ e="text/cs s">

<!--

.p9{font-s ize:9pt;fo nt-family:宋体}td{fo nt-s ize:9p t}

.tx{he ight: 16px;width:30px;border-color:b lack black#000000;border-top-width:0p x;border-right-width:0p x;bo rder-botto m-width: 1 px;b order-le ft-width:0p x;fo nt-s ize:9 pt;background-color:#eeeeee;color:#0000FF}

.tx2{he ight: 16px;border-top-width:0 px;b order-right-width:0 px;b order-botto m-width: 1 px;border-le ft-width:0px;font-size:9pt; color:#0000FF;border-le ft-color:#000000;bo rder-right-colo r:#000000;bord er-top-color:#000000;border-botto m-color:#000000}

.bt {border-left:1px solid#C0C0C0;border-top:1px solid#C 0C0C0;font-size:9pt;border-right-width: 1;border-botto m-width: 1;he ight:22 px;width:80px;bac kground-color:#EEEEEE;cursor:hand;border-right-style:so lid;b order-botto m-style:s o lid}.tx1 {width:400;height:20px;font-size:9pt;border: 1 px so lid;b order-color:b lackblack#000000;color:#0000FF}

-->

</style>

</head>

<bodybgcolor="#FFFFFF" text="#000000">

<form name="form1"method="p ost"action="up file_dtk.asp"enctyp e="multipart/form-d ata">

<input type="hidden"name="act"value="up load">

<br>

<tab le width="100%"border="1"c ellsp ac ing="0"cellp adding="5"align="c enter"borderco lordark="#C CCCCC"bo rdercolorlight="#000000">

<trbgcolor="#CCCCCC">

<td he ight="30"align="le ft"valign="middle"b gco lo r="#C CCCCC">

<p a lign="c ente r">&nb sp;相关文件上传</td>

</tr>

<tr align="left"valign="middle"bgcolor="#eeeeee">

<td bgcolor="#eeeeee"height="28">

<script language="javascript">function setid()

{str='<br>';if(!wind ow.fo rm1.upcount.value)

window.form1.upcount.value=1;fo r(i=1;i<=windo w.fo rm1.upco unt.value;i++)str+='文件'+i+' :<inp ut typ e="file"name="file'+i+'" style="wi dth:400"class="tx1"><br><br>';windo w.up id.inn erHTML=str+'<br>';

}

</script>

<li>需要上传的个数

<input typ e="text"name="upcount"class="tx"value="1">

<input typ e="butto n"name="Button"class="bt"onC lick="setid();"value="·设定·">

</li>

</td>

</tr>

<tr align="c e nter"va lig n="mi dd le">

<td a lign="le ft" id="up id"he ight="25">文件1 :

<input type="file"name="file1" style="width:400"class="tx1"value="">

</td>

</tr>

<tr align="c enter"valign="middle"bgco lor="#eeeeee">

<td bgcolor="#eeeeee"height="30">

<inp ut type="s ub mit"nam e="S ub mit"va lu e="·提交·"c las s="bt">

<input type="reset"name="Submit2"value="·重置·"clas s="bt">

</td>

</tr>

</table>

</form>

</body>

</html>

<script language="javascript">setid();

</script>

<%set rs=s erver.createobj ect("adodb.recordset")na me=tr im(re que s t("na me"))bo_Class=request("Class")if name="" then

sqltext="select*from FileInfo order by ID desc"elsesqltext="select*from FileInfo"if bo_class="按文件名"thensqltext=sqltext&"where FileN ame like'%"&name&"%'o rder by time"elseif bo_class="按上传时间" thensqltext=sqltext&"where time like'%"&name&"%'order by time"end ifend ifrs.o pen s qlte xt,conn,1,1

'-------------定义每页显示记录数dim MaxPerPage

MaxPerPage=20

'-

------------------------------

'假如没有数据时

If rs.eof and rs.bof thencall showpagesresponse.write"<p align='center'><font color='#ff0000'>还没任何学生信息</font></p>"response.end

End if

'取得页数,并判断用户输入的是否数字类型的数据如不是将以第一页显示dim te xt,c he ckpagete xt="0123456789"

Rs.P ageS ize=MaxPerP agefor i=1 to len(request("page"))checkp age=ins tr(1,te xt,mid(request("page"),i,1))if checkpage=0 thenexit forend ifne xt

If checkpage<>0 then

IfNOT IsEmpty(request("page"))Then

Curre ntPa ge=Cint(request("page"))

If CurrentPage<1 Then CurrentPage=1

If CurrentPage>Rs.PageCount Then CurrentPage=Rs.PageCount

Else

CurrentPage=1

End If

If not Rs.eof Then Rs.AbsolutePage=CurrentPage end if

Else

CurrentPage=1

End if

'callshowpagescall list

If Rs.recordcount>MaxPerP age thencallshowpagesend if

'显示帖子的子程序

Sub list()%>

<form method='POST'action='filesup_dtk.asp'>

<tab le ce llpadding="2"ce llspac ing="1"bo rder="0"width=100%cellp adding="4"align=center c lass="a3">

<TB ODY>

<tr class="a1"> <TD height="18">

<font color="#FF0000">【相关文件信息下载查看】 </fo nt>&nb sp;

&nb sp;&nb sp;&nb sp;&nb s p;&nb sp;&nb sp;&nb sp;信息检索

<select name='Clas s' size='1' tab index='0' style="font-size:9pt">

<option value='按文件名'>按文件名</option>

<option value='按上传时间'>按上传时间</option>

</select>

<input type='text'name='Name' s ize='11' onMouseO ver="this.style.backgroundCo lor='#F5F0FF'"onMous eOut="this.style.backgroundColo r=''"style="font-family:新细明体,宋体,Arial;font-size:9pt;he ight: 18;background-c olor:#f3 f3 f3;width:215;border: 1 solid black">

<inp ut typ e='s ubmit'va lue='查询'nam e='Submit' style="fo nt-fami ly:新细明体,宋体,Arial;font-s ize:9pt;height:20px;background-color:#D4D0C 8;"onMous e Over="this.style.backgroundCo lor='#FFC864'"onMouseOut

="this.style.b ackgroundC o lor='#D4D0C 8'">

</TD></TR>

<TR vAlign=top>

<TD >

<tab le ce llpadding="3"ce llspac ing="1"b order="0"width=100%cellpadding="4"align=center c lass="a2">

<tr alig n="c e nter" c las s="a4">

<td width="2%">序号</td>

<td width="6%">上传时间</td>

<td width="5%">上传地址</td>

<td width="3%">文件大小</td>

<td width="18%">下载查看</td>

<td wi dth="2%">删除</td>

</tr>

<%if not rs.eof theni=0do while not rs.eo f

%>

<tr clas s="a3"align="c enter"height=20>

<td><%=r s("i d")%></td>

<td ><%=r s("t ime")%></td>

<td><%=r s("ip")%></td>

<td><%=rs("fi le size")%> </td>

<td align='le ft'> <%=rs("F ileName")%><ahre f="<%=rs("F ile we bPath")%>"><img border="0" src="img/addpic.gif"a lt="下载查看"></a> </td>

<td va lign='midd le'> <A

HREF="<%=serverpath&"d eldb file_dtk.asp?filename="&rs("F ileName")%>">删除</A> </td>

<%i=i+1if i>=MaxPerpage then exit dors.mo venextloopend if

%>

</tab le>

</TD></TR>

</TBO DY></TABLE><br>

<%

End subrs.closeconn.close

%> </c enter>

</d iv>

<div a lign="ce nter">

<c enter>

</form>

<%

'显示翻页的子程序sub showpages()%>

<tab le cellp adding="2" cellspac ing="1"border="0"width=100%ce llpadding="4"align=center c lass="a3">

<tr><td>

<%resp onse.write "<form method=Post action='filesup_dtk.asp'>"

%>

<table c ellpadding="2" cellspacing="1"border="0"width=100%cellpadding="4"align=cente r c la ss="a2">

<trclass="a1">

<td>

<font color="#000000">

<p align="le ft">

<%

Response.write "<font color='#000000'>分页-</font>"

If currentpage>1 Thenrespo ns e.write "<a hre f='fi les up_dtk.asp?&page="+cs tr(1)+"'><fontcolor='#000000'>首页</font></a><font color='#000000'><b>-

</b></fo nt>"

Respo nse.write "<a hre f='filesup_dtk.asp?page="+C s tr(currentpage-

1)+"&name="&name&"&class="&bo_class&"'><font color='#000000'>前页

</font></a><font color='#000000'><b>-</b></font>"

Else

Response.write "<font color='#000000'>首页-</font>"

Response.write "<font color='#000000'>前页-</font>"

End if

If currentpage<Rs.PageCount Then

Res ponse.writ e "<ahre f='filesup_dtk.a sp?page="+C str(currentPage+1)+"&name="&name&"&c las s="&b o_class&"'><font color='#000000'>后页</font></a><font color='#000000'><b>-

</b></fo nt>"

Re sp onse.wr ite

"<a href='file sup_dtk.asp?page="+Cstr(Rs.PageCount)+"&name="&name&"&class="&bo_class&"'><font color='#000000'>尾页</font></a>&nbsp;&nbsp;"

Else

Response.write "<font color='#000000'>后页-</font>"

Response.write "<font color='#000000'>尾页

</fo nt>&nb sp;&nb s p;"

End if

Response.write "<font color='#000000'>页次:</font>"&"<font color=#FF0000>"&Cstr(CurrentPage)&"</font>"&"<font co lo r='#000000'>/"&Cstr(rs.pagec ount)&"</fo nt>&nb s p;"

Response.write "<font c olor=#ff0000>"&Cstr(MaxPerPage)&"</font>"&"<font color='#000000'>条记录/页&nbsp"&"共</font>"&"<font color=#FF0000>"&Cstr(Rs.RecordCount)&"</font>"&"<font co lor='#000000'>条记录

</font>&nbsp;&nbsp;"resp onse.write "</td><td alig n='ri ght'>"response.write"<font c o lor='#ffffff' class=main 1>转到 </font><input type='text'name='page' size=4 maxlength=4 class=smallInputvalue="&Currentp age&">&nbsp;"response.write"<input class=buttonface type='submit' value='Go' name='cndok'style='b ackground-co lor:#FF FFFF'></span>&nbsp;&nbsp;"

%>

</font>

</td>

</tr>

</table>

</center>

</td></tr>

</tab le>

</form>

<%end sub%> </body>

</ht ml>

<%functio n GetF ileP ath(F ullPath,str)

If FullPath<>""Then

GetFileP ath=le ft(FullPath,InStrRe v(FullPath, s tr))

Else

Ge tF ile P ath=""

End If

End function

%>

盘点618年中大促中这款云服务器/VPS主机相对值得选择

昨天有在"盘点2021年主流云服务器商家618年中大促活动"文章中整理到当前年中大促618活动期间的一些国内国外的云服务商的促销活动,相对来说每年年中和年末的活动力度还是蛮大的,唯独就是活动太过于密集,而且商家比较多,导致我们很多新人不懂如何选择,当然对于我们这些老油条还是会选择的,估计没有比我们更聪明的进行薅爆款新人活动。有网友提到,是否可以整理一篇当前的这些活动商家中的促销产品。哪些商家哪款产...

无忧云:洛阳/大连BGP云服务器38.4元/月,雅安物理机服务器315元/月起,香港荃湾CN2限时5折优惠

无忧云怎么样?无忧云是一家成立于2017年的老牌商家旗下的服务器销售品牌,现由深圳市云上无忧网络科技有限公司运营,是正规持证IDC/ISP/IRCS商家,主要销售国内、中国香港、国外服务器产品,线路有腾讯云国外线路、自营香港CN2线路等,都是中国大陆直连线路,非常适合免备案建站业务需求和各种负载较高的项目,同时国内服务器也有多个BGP以及高防节点,目前商家开启了夏日清凉补贴活动,商家的机器还是非常...

欧路云(22元/月),美国CERA弹性云服务器!香港弹性云服务器15元/月起;加拿大高防vps仅23元/月起

欧路云怎么样?欧路云主要运行弹性云服务器,可自由定制配置,可选加拿大的480G超高防系列,也可以选择美国(200G高防)系列,也有速度直逼内地的香港CN2系列。所有配置都可以在下单的时候自行根据项目 需求来定制自由升级降级 (降级按天数配置费用 退款回预存款)。2021年7月14日美国 CERA 弹性云服务器 上新 联通CUVIP 线路!8折特惠中!点击进入:欧路云官方网站地址付款方式:PayPa...

asp 文件上传为你推荐
湖南商标注册在湖南商标注册到底有什么用,不就是一个图标吗?真正免费的网络电话有真正的免费的网络电话吗 ?自助建站自助建站哪个平台最好?pwpw域名的技巧网站运营网络运营具体做什么呢数码资源网哪个网站可以直接在线做照片?功能要齐全的`ps抠图技巧ps抠图多种技巧,越详细越好,急~~~~~~~开机滚动条怎么减少开机滚动条?怎么升级ios6苹果iPhone6怎么升级系统免费免费建站电脑上有真正免费的网站吗??
手机域名注册 日本私人vps 服务器配置技术网 info域名 网通代理服务器 ibrs 警告本网站美国保护 圣诞促销 web服务器的架设 idc资讯 架设邮件服务器 云营销系统 免费的asp空间 电信网络测速器 学生服务器 中国联通宽带测试 97rb 阿里云邮箱怎么注册 japanese50m咸熟 wannacry勒索病毒 更多