用于删除附件的处理页面
<%
@ page language
=
"
java
"
contentType
=
"
text/html; charset=GB18030
"
pageEncoding = " GB18030 " %>
<! DOCTYPE html PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN " " http://www.w3.org/TR/html4/loose.dtd " >
< html >
< head >
< meta http - equiv = " Content-Type " content = " text/html; charset=GB18030 " >
</ head >
< body >
<%
if (request.getParameter( " delallf " ) == null ) ... {
//out.println(request.getParameter("delallf"));
%>
<form name="del" action="./delappendfile.jsp" method="POST">
<input type="hidden" name="delallf">
</form>
<script>
//从打开页面(即附件列表页面的记录要删除附件名称的域中读出数据,并提交以供删除)
document.all.delallf.value=window.opener.document.all.delall.value
document.all.del.submit()
</script>
<%
} else ... {
//out.println(request.getParameter("delallf"));
String delFiles=request.getParameter("delallf");
String documentRoot=getServletContext().getRealPath("/")+"appendfiles/";
java.io.File delFile=null;
String [] delFilesList=delFiles.split("@");
for(int i=0;i<delFilesList.length;i++)...{
delFile=new java.io.File(documentRoot+delFilesList[i]);
if(delFile.exists())...{
delFile.delete();
}
}
%>
<script>
alert("<%=delFilesList.length-1%>个附件被删除")
this.close()
window.opener.document.location.reload()
</script>
<%
}
%>
</ body >
</ html >
pageEncoding = " GB18030 " %>
<! DOCTYPE html PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN " " http://www.w3.org/TR/html4/loose.dtd " >
< html >
< head >
< meta http - equiv = " Content-Type " content = " text/html; charset=GB18030 " >
</ head >
< body >
<%
if (request.getParameter( " delallf " ) == null ) ... {
//out.println(request.getParameter("delallf"));
%>
<form name="del" action="./delappendfile.jsp" method="POST">
<input type="hidden" name="delallf">
</form>
<script>
//从打开页面(即附件列表页面的记录要删除附件名称的域中读出数据,并提交以供删除)
document.all.delallf.value=window.opener.document.all.delall.value
document.all.del.submit()
</script>
<%
} else ... {
//out.println(request.getParameter("delallf"));
String delFiles=request.getParameter("delallf");
String documentRoot=getServletContext().getRealPath("/")+"appendfiles/";
java.io.File delFile=null;
String [] delFilesList=delFiles.split("@");
for(int i=0;i<delFilesList.length;i++)...{
delFile=new java.io.File(documentRoot+delFilesList[i]);
if(delFile.exists())...{
delFile.delete();
}
}
%>
<script>
alert("<%=delFilesList.length-1%>个附件被删除")
this.close()
window.opener.document.location.reload()
</script>
<%
}
%>
</ body >
</ html >