home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 July
/
CMCD0703.ISO
/
Software
/
Freeware
/
Programare
/
bugzero
/
jsp
/
attachment.jsp
< prev
next >
Wrap
Text File
|
2003-06-05
|
3KB
|
98 lines
<%@ page language="java"
session="true"
import="com.websina.util.*,com.websina.bean.*,com.websina.util.log.Log"
errorPage="error.jsp"
%>
<%
String contextPath = request.getContextPath();
String formId = request.getParameter("formId");
IssueForm issueForm = null;
if(formId != null) {
issueForm = (IssueForm)session.getAttribute("issueForm"+formId);
}
if (issueForm == null) {
out.print("<center><font color=red><b>");
out.print("Sorry, you are in an invalid state");
out.print("</b></font></center>");
return;
}
Label label = Label.getInstance();
%>
<html>
<head>
<title>File Attachment</title>
<meta http-equiv=Content-Type content="text/html">
<script LANGUAGE="JavaScript" src="script/attachment.js"></script>
</head>
<!-- you may redo the interface below -->
<body bgcolor="#ffffff">
<center>
<br>
<table bgcolor="#dde8ee" cellspacing=0 cellpadding=2 border=0>
<tr><td colspan=3 bgcolor="#ffffff">
<b>File Attachment</b>
</td></tr>
<tr><td bgcolor="#006688" colspan=3>
<font size="-1" color="#ffffff">
<b>Attach a file in two steps, repeating the steps as needed to attach multiple files.
Click OK when you are done</b>
</font>
</td></tr>
<tr><td colspan=3> </td></tr>
<tr><td>
1. Click <b>Browse</b> to select the file, or<br>
type the path to the file in the field below.
</td><td colspan=2>
2. Click <b>Attach</b> to move the file
<br> to the Attached Files box.
</td></tr>
<tr><td colspan=3> </td></tr>
<tr><td colspan=2>
Find File</td>
<td>Attached Files</td></tr>
<tr><td>
<form method="POST" ENCTYPE="multipart/form-data"
action="<%=contextPath%>/servlet/upload?<%=formId%>">
<input type=file size=32 name=attachment></td>
<td align=center>
<input type=submit value=" Attach "></td>
</td>
</form>
<form method="POST" name="attachForm"
action="<%=contextPath%>/servlet/upload?<%=formId%>">
<input type="hidden" name="action">
<td rowspan=3>
<select name=attached_files size=5 multiple>
<%
Attachment attachment = issueForm.getAttachment();
if (attachment != null) {
%>
<%=ListMaker.makeOptionList(attachment.getAllFilenames()) %>
<% } %>
</select></td>
</tr>
<tr><td> </td>
<td align=center><input type=button value="Remove"
onClick="do_remove(attachForm)">
</td></tr>
<tr><td colspan=2 height=32> </td></tr>
<tr><td height=50><hr></td>
<td colspan=2 align=center>
<input type=button value=" OK " onClick="do_ok(attachForm)">
<input type=button value="Cancel" onClick="do_cancel(attachForm)">
</td></tr>
</form>
<% String msg = request.getParameter("msg");
if (msg != null) {
%>
<tr><td colspan=3 align=center>
<font color=red><b><%=msg%></b></font>
</td></tr>
<% } %>
</table>
</center>
</body>
</html>