<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.util.*,java.io.*,com.form.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文件管理</title>
</head>
<body>
<table width="343" border="1" align="center">
<tr>
<td width="127"><table width="127" border="0">
<tr>
<td height="39" class="STYLE">文件名</td>
</tr>
</table></td>
<td colspan="2"><table width="201" border="0">
<tr>
<td width="191" height="39" class="STYLE">操作</td>
</tr>
</table></td>
</tr>
<%
//要下载的文件的路径
File dir=new File("E://save//");
File file[]=dir.listFiles();
//把所用的文件都列出来
for(int i=0;i<file.length;i++){
%>
<tr>
<td height="52"><table width="127" border="0">
<tr>
<td height="42" class="STYLE"><%=file[i].getName()%></td>
</tr>
</table></td>
<td width="94"><table width="94" border="0">
<tr>
<td width="84" height="39" class="STYLE"><a href="/FileDownload_Delete.do?act=downLoad&filename=<%=file[i].getName()%>">下载</a></td>
</tr>
</table></td>
<td width="100"><table width="100" border="0">
<tr>
<td width="90" height="39" class="STYLE"><a href="/FileDownload_Delete.do?act=delete&filename=<%=file[i].getName()%>">删除</a></td>
</tr>
</table></td>
</tr>
<%
}
%>
</table>
</body>
</html>
文件下载
最新推荐文章于 2025-01-17 13:39:34 发布