addToList.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:2k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%@ page import="com.vnex.intranet.util.TimeStamp" %>
  3. <%@ page import="com.vnex.intranet.pub.BaseJdbcDAO" %>
  4. <%@ page import="com.vnex.intranet.upload.*"%>
  5. <%@ page import="com.vnex.intranet.util.SubPathGenerater" %>
  6. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader"%>
  7. <jsp:useBean id="mySmartUpload" scope="request" class="com.vnex.intranet.upload.SmartUpload" />
  8. <jsp:useBean id="aavb" scope="request" class="com.vnex.intranet.archives.value.ArchiveAttachmentValueBean" />
  9. <jsp:useBean id="archiveProxy" scope="application" class="com.vnex.intranet.archives.proxy.ArchiveProxyBean" />
  10. <%
  11.     String root = ConfigParaLoader.getParameter("rootUrl");
  12.     String seperator = SubPathGenerater.getSeperator();
  13.     aavb.setSendDate(TimeStamp.convertTimestampToCalendar(BaseJdbcDAO.getDBSystemDate()));
  14.     mySmartUpload.initialize( pageContext );
  15.     mySmartUpload.setTotalMaxFileSize(ConfigParaLoader.getParameterByInt("attachmentSize"));
  16.     mySmartUpload.upload();
  17.     String attachURL = ConfigParaLoader.getParameter("archiveAttachmentUrl");
  18.     attachURL += seperator+ SubPathGenerater.getSubPath( root + seperator + attachURL);
  19.     String ext = mySmartUpload.getFiles().getFile(0).getFileName();
  20.     if(ext.indexOf(".") != -1)
  21.        ext = ext.substring(ext.indexOf("."));
  22.     else
  23.        ext = "";
  24.     String fileFullName = root+seperator+attachURL+seperator+mySmartUpload.getRequest().getParameter("fileName")+ext;
  25.     aavb.setFileName(fileFullName);
  26.     aavb.setFileTitle(mySmartUpload.getRequest().getParameter("fileTitle"));
  27.     aavb.setFileSummary(mySmartUpload.getRequest().getParameter("fileSummary"));
  28.     aavb.setOthers(mySmartUpload.getRequest().getParameter("others"));
  29.     aavb.setArchiveId(Integer.parseInt(request.getParameter("archiveId")));
  30.     com.vnex.intranet.upload.File myFile = mySmartUpload.getFiles().getFile(0);
  31.     myFile.saveAs(fileFullName);
  32.     archiveProxy.addAttachment(aavb);
  33. %>
  34. <html>
  35. <head>
  36. <script language=javascript>
  37. function forward()
  38. {
  39. document.location = "/mainctrl/archive/archiveDetail?archiveId=<%=aavb.getArchiveId()%>";
  40. }
  41. </script>
  42. </head>
  43. <body onload="javascript:forward()">
  44. </body>
  45. <html>