📄 index.asp
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn">
<head>
<title>AnUpload组件上传类9.1.9 示例(最简单的文件上传)</title>
<style>
body,table,textarea,span,div,a,input,pre{
font-family:verdana,tahoma,arial;
}
FORM {margin:3px;}
input {border:1px #bbbbbb solid;background-color:#ffffff;}
textarea {border:1px #bbbbbb solid;background-color:#ffffff;}
.iText {height:16px;}
.iFile {height:20px;}
.iButton {height:20px;padding:2px;background-color:#eeeeee;}
.iCheck {border:0px;}
</style>
</head>
<body style="font-size:12px">
艾恩ASP无组件上传类演示 (<a href="index.asp?act=del">清理文件夹</a>)<hr />
<table width="80%">
<tr>
<td class="title">
单文件上传(single)</td>
<td class="introduce" colspan="2">
上传一个文件到服务器 <a href="demo/single/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
表单遍历(forms)</td>
<td class="introduce" colspan="2">
遍历所有提交的表单 <a href="demo/forms/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
多文件文件上传(muti)</td>
<td class="introduce" colspan="2">
上传多个文件到服务器,使用遍历方法 <a href="demo/muti/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
文本和文件混合上传(allinone)</td>
<td class="introduce" colspan="2">
文本和文件混合上传到服务器 <a href="demo/allinone/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
提取文件二进制信息(bytes)</td>
<td class="introduce" colspan="2">
提取文件二进制信息 <a href="demo/bytes/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
弹窗上传(demo2)</td>
<td class="introduce" colspan="2">
弹出窗口上传文件,完成后返回原窗口 <a href="demo/demo2/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
六行代码实现上传(sixline)</td>
<td class="introduce" colspan="2">
六行代码实现上传 <a href="demo/sixline/index.asp" target="_blank">现在测试</a></td>
</tr>
<tr>
<td class="title">
综合上传示例(demo1)</td>
<td class="introduce" colspan="2">
综合上传示例,保存客户提交信息到数据库 <a href="demo/demo1/index.asp" target="_blank">现在测试</a></td>
</tr>
</table>
<hr />
开发文档下载:<a href="http://www.ii-home.cn/an-upload/AnUpload.pdf" target ="_blank" >艾恩ASP无组件上传类开发文档</a><br />
类源代码下载:<br />
本地下载:<a href="http://www.ii-home.cn/detial.asp?id=143" target="_blank" >艾恩ASP无组件上传类下载</a><br />
站长下载:<a href="http://down.chinaz.com/soft/24607.htm" target="_blank" >艾恩ASP无组件上传类下载</a><br />
本类推出组件版:<a href="http://www.ii-home.cn/detial.asp?id=167" target="_blank" >艾恩ASP文件上传组件</a><br />
<hr />
艾恩ASP无组件上传类,不敢夸口说多完美,但能实现基本的功能.<br />包括提取表单数据、上传到不同文件夹、保存到数据库(上传和保存表单可同时进行)、限制上传扩展名、限制上传大小、选择文件保存类型(原文件名和时间随机命名)等!<br />
本类特点: <br /><br />
<li />尽量追求简洁,减少赘余代码 <br />
<li />全面保存客户提交的信息(普通表单,文件域值,相同表单值) <br />
<li />准确获取上传中的错误信息 <br />
<li />可选择文件保存方式(以原文件名保存和以新文件名保存,新文件名为时间+随机数字组成) <br />
<li />文件保存函数简洁,调用方便,并且比较灵活(保存路径和保存方式可随时改变) <br />
<li />同时可以获取文件的二进制形式,从而可以实现将二进制数据保存到数据库 <br />
<li />灵活运用本类,可以实现表单数据和文件同时编辑(这是一般类无法达到的) <br />
<li />更多的用途靠大家来发现了..... <br />
<li />Demo里面有几个个很简单的例子,能掌握这几个个例子一定可以灵活使用本类 <br /><br />
</body>
</html>
<%
if request.querystring("act")="del" then
path=server.mappath("demo")
dim fso:set fso=server.createobject("scripting.filesystemobject")
dim folder
dim count:count=0
call delFiles(path)
response.write "清理完毕!共删除" & count & "个文件!"
set fso=nothing
end if
function delFiles(folderPath)
set folder=fso.getfolder(folderPath)
for each fold in folder.subfolders
if (lcase(fold.name)="files" or lcase(fold.name)="pics") and fold.files.count>0 then
for each file in fold.files
fso.deletefile folderPath & "\" & fold.name & "\" & file.name
count=count+1
next
end if
set folder=nothing
call delFiles(folderPath & "\" & fold.name)
next
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -