asp上传文件代码
add.html
<html>
<head>
<title>无组件上传</title>
</head>
<body>
<form method="POST" name="myform" action="xSave.asp" target="_self">
<input name="PicPath" type="text" id="PicPath" readonly="true">
<input name="sPicPath" type="hidden" id="sPicPath">
<iframe id="Upload" src="upload.html" frameborder=0 scrolling=no width="100%" height="20"></iframe>
<img src="" id="objimg" style="display:none;" />
</form>
</body>
</html>
upload.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language=javascript>
function check_file()
{
var strFileName=form.FileName.value;
if (strFileName=="")
{
alert("请选择要上传的文件");
return false;
}
}
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<form action="upfile.asp" method="post" name="form1" enctype="multipart/form-data">
<input name="FileName" type="FILE" class="tx1" size="20" onChange="window.parent.document.getElementById('objimg').src=this.value;window.parent.document.getElementById('objimg').style.display='';">
<input type="submit" name="Submit" value="上传">
</form>
</body>
</html>
upfile.asp
<!--#include file="upload.asp"-->
<%
Const MaxFileSize=2048 '上传文件大小限制单位k
Const UpFileType="gif|jpg|bmp|png" '允许的上传文件类型
set fs=createobject("scripting.filesystemobject")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
call upload_0() '使用化境无组件上传类
%>
</body>
</html>
<%
sub upload_0() '使用化境无组件上传类
set upload=new upload_file '建立上传对象
&n
相关文档:
前两天,客户需要添加下拉菜单,我晕的很,很简单的一个问题把我诱导了两三天,后来醒悟过来,真想打自己。
之前我也使用过div套div的方法,只要控制他们的位置就可以了,但这次我没有,使用的在表格式套div,自己琢磨了半天,已经忘记了div所显示的是相对 ......
如何令你的网站“动感十足”
您的网站是否仍一如既往地保持“静态”?目前呈几何增长的互联网网站中,有相当一部分仍固守“静态”,无形中已大大落后于时代的步伐。所谓“静态”指的就是网站的网页内容“固定不变”,当用户浏览器通过互联网的HTTP(Hypertext Transpor ......
asp中插入与修改数据的几种方式。为了方便解说,我们先建立一个名为test的表,表内只有两个数据
项:username和email,分别用来存储用户名与邮箱地址。
1.利用insert语句插入数据:
insert是sql语句的基本指令之一, 用法很简单,这里我只将其基本格式列出.
代码如下:
set conn=s ......
有2种使用cookie的基本方式:
1、将cookie写入访问者的计算机(使用 RESPONSE 命令)
2、从访问者的计算机中取回cookie(使用 REQUEST 命令)
创建cookie的基本语法
Response.Cookies("CookieName")=value //将值value写入cookie
执行下面的代码将会在访问者的计算机中创建一个cookie,名字=VisitorNam ......
ASP高级技术精选集
一、GetRows的使用方法:
<%
Set conn=Server.CreateObject("Adodb.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("test.mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.Open "Select Top 2 * from 表名",conn,0,1 &nb ......