add_upload_file.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:7k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page import="com.vnex.intranet.pub.BaseJdbcDAO" %>
- <%@ page import="com.vnex.intranet.util.TimeStamp" %>
- <%@ page import="java.io.File" %>
- <%
- int archiveId = Integer.parseInt(request.getParameter("archiveId"));
- String sendDate = TimeStamp.formatCalendar(TimeStamp.YMD, TimeStamp.convertTimestampToCalendar(BaseJdbcDAO.getDBSystemDate()));
- %>
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_archives.js"></script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
- <script language="JavaScript" src="/vnex/validate.js"></script>
- <script language=javascript>
- function checkChar(str)
- {
- var i,j,strTemp;
- strTemp=""<>/\'%&+-";
- for (i=0;i<str.length;i++)
- {
- j=strTemp.indexOf(str.charAt(i));
- if (j!=-1)
- {
- return false;
- }
- }
- return true;
- }
- function isDataValid(form)
- {
- if (form.sourceFile.value == "")
- {
- alert("源文件不能为空!");
- form.sourceFile.focus();
- return false;
- }
- if (form.fileName.value == "")
- {
- alert("文件名不能为空!");
- form.fileName.focus();
- return false;
- }
- if(!checkChar(form.fileName.value))
- {
- alert("文件名称中不要加入"<>/\'%&+-这样的字符");
- form.fileName.focus();
- return false;
- }
- if (form.fileTitle.value.length == 0)
- {
- alert("标题不能为空!");
- form.fileTitle.focus();
- return false;
- }
- str = form.fileTitle.value;
- if (str.substring(0,1) == " ")
- {
- alert("标题开头不能是空格!");
- form.fileTitle.focus();
- return false;
- }
- if (form.fileSummary.value.length > 125)
- {
- alert("文件的摘要必须小于125个文字!");
- form.fileSummary.focus();
- return false;
- }
- if (form.others.value.length > 250)
- {
- alert("备注必须小于250个文字!");
- form.fileSummary.focus();
- return false;
- }
- return true;
- }
- function uploadDoc(form)
- {
- if (! isDataValid(form))
- return false;
- form.encoding="multipart/form-data";
- form.action="/mainctrl/archive/uploadFile?archiveId=<%=archiveId%>&isToday=<%=request.getParameter("isToday")%>";
- form.submit();
- }
- function toDetail(form)
- {
- form.action="/mainctrl/archive/archiveDetail?archiveId=<%=archiveId%>&isToday=<%=request.getParameter("isToday")%>";
- form.submit();
- }
- function fileSelected(form)
- {
- var sname = form.sourceFile.value;
- sname = sname.substring(sname.lastIndexOf("\")+1);
- if(sname.indexOf(".") != -1)
- sname = sname.substring(0, sname.indexOf("."));
- form.fileName.value = sname;
- }
- </script>
- <DIV align=center>
- <form name="form1" method="post">
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
- <TR>
- <TD colSpan=3 align="center"><br>
- <table width="600" border="1" cellspacing="1" bordercolor="#666666">
- <tr>
- <td align="center" colspan="2" bgcolor="#FFFFFF">
- <table width="600" border="0" cellspacing="0" cellpadding="0">
- <tr bgcolor="#666666">
- <td colspan="2"><font class="strongw"><a href="/mainctrl/home/index"><font color="#ffffff">首页</font></a>>><a href="/mainctrl/archive/todayArchives"><font color="#ffffff">档案管理</font></a>>><a href="/mainctrl/archive/archiveDetail?archiveId=<%=archiveId%>"><font color="#ffffff">档案信息</font></a>>>增加文件</font>
- </td>
- </tr>
- </table>
- <table class=title border="0" cellpadding="2" cellspacing="1" width="600">
- <tr bgcolor="#fafafa">
- <td width="14%">
- <div align="left"><strong> 源文件:</strong></div>
- </td>
- <td width="86%">
- <div align="left">
- <input type="file" name="sourceFile" size="30" class="text" onchange="fileSelected(this.form)">
- </div>
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="14%">
- <div align="left"><strong> 文件名:</strong></div>
- </td>
- <td width="86%">
- <div align="left">
- <input type="text" name="fileName" size="30" maxlength=50 class="text"> * (注:带*为必填内容)
- </div>
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="14%">
- <div align="left"><strong> 标题:</strong></div>
- </td>
- <td width="84%">
- <div align="left">
- <input type="text" name="fileTitle" size="30" maxlength=250 class="text"> *
- </div>
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="14%">
- <div align="left"><strong> 概要:</strong></div>
- </td>
- <td width="86%">
- <div align="left">
- <textarea rows="5" name="fileSummary" cols="59" wrap="VIRTUAL"></textarea>
- </div>
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="14%">
- <div align="left"><strong> 上传日期:</strong></div>
- </td>
- <td width="86%">
- <div align="left"><%=sendDate%></div>
- </td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="14%">
- <div align="left"><strong> 备注:</strong></div>
- </td>
- <td width="86%" valign="top">
- <div align="left">
- <textarea name="others" cols="59" wrap="VIRTUAL" rows="5"></textarea>
- </div>
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td colspan="2" align="center" height="30">
- <input onClick="uploadDoc(this.form)" type="button" value="上传" name="B21" class="text">
-
- <input type="reset" value="重置" name="B212" class="text">
-
- <input onClick="toDetail(this.form)" type="button" value="返回" name="B213" class="text">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
- </TD>
- </TR>
- <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
- </TBODY>
- </TABLE>
- <BR>
- <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
- </form>
- </DIV>
- </BODY>
- </HTML>