addToList.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:2k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="com.vnex.intranet.util.TimeStamp" %>
- <%@ page import="com.vnex.intranet.pub.BaseJdbcDAO" %>
- <%@ page import="com.vnex.intranet.upload.*"%>
- <%@ page import="com.vnex.intranet.util.SubPathGenerater" %>
- <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
- <jsp:useBean id="mySmartUpload" scope="request" class="com.vnex.intranet.upload.SmartUpload" />
- <jsp:useBean id="aavb" scope="request" class="com.vnex.intranet.archives.value.ArchiveAttachmentValueBean" />
- <jsp:useBean id="archiveProxy" scope="application" class="com.vnex.intranet.archives.proxy.ArchiveProxyBean" />
- <%
- String root = ConfigParaLoader.getParameter("rootUrl");
- String seperator = SubPathGenerater.getSeperator();
- aavb.setSendDate(TimeStamp.convertTimestampToCalendar(BaseJdbcDAO.getDBSystemDate()));
- mySmartUpload.initialize( pageContext );
- mySmartUpload.setTotalMaxFileSize(ConfigParaLoader.getParameterByInt("attachmentSize"));
- mySmartUpload.upload();
- String attachURL = ConfigParaLoader.getParameter("archiveAttachmentUrl");
- attachURL += seperator+ SubPathGenerater.getSubPath( root + seperator + attachURL);
- String ext = mySmartUpload.getFiles().getFile(0).getFileName();
- if(ext.indexOf(".") != -1)
- ext = ext.substring(ext.indexOf("."));
- else
- ext = "";
- String fileFullName = root+seperator+attachURL+seperator+mySmartUpload.getRequest().getParameter("fileName")+ext;
- aavb.setFileName(fileFullName);
- aavb.setFileTitle(mySmartUpload.getRequest().getParameter("fileTitle"));
- aavb.setFileSummary(mySmartUpload.getRequest().getParameter("fileSummary"));
- aavb.setOthers(mySmartUpload.getRequest().getParameter("others"));
- aavb.setArchiveId(Integer.parseInt(request.getParameter("archiveId")));
- com.vnex.intranet.upload.File myFile = mySmartUpload.getFiles().getFile(0);
- myFile.saveAs(fileFullName);
- archiveProxy.addAttachment(aavb);
- %>
- <html>
- <head>
- <script language=javascript>
- function forward()
- {
- document.location = "/mainctrl/archive/archiveDetail?archiveId=<%=aavb.getArchiveId()%>";
- }
- </script>
- </head>
- <body onload="javascript:forward()">
- </body>
- <html>