asp上传页面中已经上传了,如何将上传文件以列表的方式显示的问题,请大家帮忙?

michel2l8 2008-04-23 10:24:30
已经实现上传到空间指定文件夹的功能,目前需要将文件夹的文件以列表形式显示出来,
并能够实现点击下载的功能,有人告诉我用fso做,但我实在菜鸟搞不出来啊,怎么做?

upload.htm

<html><title>example</title>
<body>
<form name="form1" method="post" action="upload.asp" enctype="multipart/form-data">
<input type=file name="file1">
<input type=file name="file2">
<input type=file name="file3">
<input type=submit name="submit" value="提交">
</form>
</body>
</html>


-------------------------------
upload.asp

<html><title>example</title>
<body>
<!--#include FILE="upload_5xsoft.inc"-->
<%
set upload=new upload_5xsoft

''列出所有form数据
for each formName in upload.objForm
response.write formName&"="&upload.objForm(formName)&"<br>"
next

''列出所有文件
for each formName in upload.objFile
set file=upload.objFile(formName)
if file.FileSize>0 then
'file.SaveAs Server.mappath(file.FileName)
file.SaveAs Server.mappath("test/"&file.FileName)
'file.SaveAs Server.mappath( "\test\" & file.FileName)
response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "
response.write file.FileName&" 成功!<br>"
end if
set file=nothing
next
set upload=nothing
%>


以上是上传代码
...全文
216 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
herolg 2008-04-23
  • 打赏
  • 举报
回复
有两种方法,一种是改程序,在程序里面加上写数据库的代码,把你的文件名存到数据库,然后在页面上读取输出就可以了,另一种是不改程序,fso遍历你的服务器上存放文件的文件夹,把所有的文件显示出来
michel2l8 2008-04-23
  • 打赏
  • 举报
回复
存在test里面,fso如何上手?能介绍点学习方法吗?
若白师妹 2008-04-23
  • 打赏
  • 举报
回复
你的文件名存在什么地方?

fso很简单,菜就去学

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧