您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> asp >> 正文

Asp深度揭密(下)

作者:佚名    信息学院来源:整理    点击数:    更新时间:2008-1-24 我要参与讨论

  f
%>

3. 操作XML文件

本次交流时间有限,有时间再做详细探讨

4.文件上传

⑴.安装文件上传组件Asp fileup(支持多文件上传,文件类型及大小判断,文件上传后改名等)
⑵.重起IIS以使上传组件生效
⑶.设置上传目录的文件权为Internet用户可以读取、写入和修改
⑷.代码部分
upload_file.htm
<style type="text/css">
<!--
.input {background-color: #FFFFFF; border-bottom: black 1px solid;border-left: black 1px solid; border-right: black 1px solid;border-top: black 1px solid; color: #000000;font-family: Georgia; font-size: 9pt;color: midnightblue;}
a:link {color: #1B629C; text-decoration: none}
a:hover {color: #FF6600; text-decoration: underline}
a:visited {text-decoration: none}
-->
</style>

<center>
<form enctype="multipart/form-data" method="post" action="upload_file.asp" name="Upload">
<input type="hidden" name="CopyrightInfo" value="http://www.chinaasp.com">
请选择文件:<input type="file" name="file1" class="input"><br><br>
请选择文件:<input type="file" name="file2" class="input"><br><br>
</form>
<br><br>
<a href="javascript:document.Upload.submit();"> 提 交 </a>
</center>


upload_file.asp
<%
on error resume next

'定义获得文件后缀的函数
function getfileextname(filename)
pos=instrrev(filename,".")
if pos>0 then
getfileextname=mid(filename,pos+1)
else
getfileextname=""
end if
end function

'定义获取文件正名的函数
function getfilename(filename)
lens=len(filename)-len(getfileextname(filename))-1
getfilename=left(filename,lens)
end function

'创建文件上传组件的对象
set fileup=server.createobject("chinaasp.upload

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页

在google里搜索更多Asp深度揭密(下)

Google
Web www.51ec.org
  • 上一篇信息学院:

  • 下一篇信息学院:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    我来说两句 对此文章发表了评论
      昵 称: *必填    ·注册用户·
      评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
    评 论
    内 容

     
    评论列表 (最新 评论仅限网友观点!)

    供求信息




    | 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明