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
相关文档:
一、Request 对象
可以使用 Request 对象访问任何基于 HTTP 请求传递的所有信息,包括从 HTML 表格用 POST 方法或 GET 方法传递的参数、cookie 和用户认证。
Request[.集合|属性|方法](变量)
1、Form
Form 集合通过使用 POST 方法的表格检索邮送到 HTTP 请求正文中的表格元素的值。
Request.Form(element)[(i ......
这个模板引擎比较方便,跟HTML结合了
Class template
Private c_Char, c_Path, c_FileName, c_Content, c_PageUrl, c_CurrentPage, c_PageStr, ReplacePageStr
Private TagName
' ***************************************
' 设置编码
' ***************************************
Public Property Let Char( ......
asp now函数,ASP时间函数详解 ,asp时间函数大全,asp 星期函数
now() 获取当前系统日期和时间,ASP输出可以这样写:<%=now()%>
Year(now()) 获取年份, ASP输出:<%=Year(now())%>
Month(now()) 获取当前月份,ASP输出:<%=Month(now())%>
day(now()) ......
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 ......