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
相关文档:
<Html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>生成Word文档</title>
</head>
<script ......
1. 用DSN连接并且没有用户名和密码:
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.open "YourDSNName"
%>
用DSN连接并且有用户名和密码:
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.open "YourDSNName","username","password"
%>
2. 用实际的数据库绝对路径连接 ......
学ASP到现在已有许多年,好多人都说他这个不好那个不好,可我觉得挺好,我却说不出什么好的理由让客户选择用ASP开发,终于看到了这个文章,心中大喜,转给大家分享~~
ASP是一种类似HTML(Hypertext Markup Language超文本标识语言)、Script与CGI(Common GAteway Interface 通用网关接口)的结合体,但是其运行效率却比 ......
今天重新整理电脑,找到一个文件,看了下日期(2006.11.5) ,怕不小心再丢了,存到网上来晒晒。
安装与配置
1.5.1安装IIS
控制面板_ 添加删除程序_添加删除Windows组件_
"internet信息服务(IIS)"对话框_详细信息——"Word Wide Web服务器" _ 单击两个“确定”—&mda ......