project_create_upload.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:4k
源码类别:
电子政务应用
开发平台:
Java
- <%
- String root = ConfigParaLoader.getParameter("rootUrl");
- if( request.getParameter("type") !=null && Integer.parseInt( request.getParameter("type") ) == 1 ) //上传文件
- {
- String attachURL = ConfigParaLoader.getParameter("workflowAttachmentUrl");
- attachURL += SubPathGenerater.getSeperator() + SubPathGenerater.getSubPath( root + SubPathGenerater.getSeperator() + attachURL);
- //上传文件
- // Initialization
- mySmartUpload.initialize( pageContext );
- mySmartUpload.setTotalMaxFileSize( Integer.parseInt( ConfigParaLoader.getParameter("attachmentSize") ) );
- mySmartUpload.setDeniedFilesList("exe,bat,jsp");
- // Upload
- mySmartUpload.upload();
- mySmartUpload.save( root + SubPathGenerater.getSeperator() + attachURL );
- //保存已有信息
- if( mySmartUpload.getRequest().getParameter("title") != null )
- pvb.setTitle( mySmartUpload.getRequest().getParameter("title") );
- if( mySmartUpload.getRequest().getParameter("planBeginDateS") != null && !mySmartUpload.getRequest().getParameter("planBeginDateS").equals("") )
- pvb.setPlanBeginDateS( mySmartUpload.getRequest().getParameter("planBeginDateS") );
- if( mySmartUpload.getRequest().getParameter("planEndDateS") != null && !mySmartUpload.getRequest().getParameter("planEndDateS").equals("") )
- pvb.setPlanEndDateS( mySmartUpload.getRequest().getParameter("planEndDateS") );
- if( mySmartUpload.getRequest().getParameter("description") != null )
- pvb.setDescription( mySmartUpload.getRequest().getParameter("description") );
- if( mySmartUpload.getRequest().getParameter("templateId") != null )
- pvb.setTemplateId( Integer.valueOf( mySmartUpload.getRequest().getParameter("templateId") ).intValue() );
- if( mySmartUpload.getRequest().getParameterValues("stepNos") != null )
- pvb.setStepNos( mySmartUpload.getRequest().getParameterValues("stepNos") );
- Collection c = pvb.getFiles();
- for(int i=0;i<mySmartUpload.getFiles().getCount();i++)
- {
- com.vnex.intranet.upload.File myFile = mySmartUpload.getFiles().getFile(i);
- if (!myFile.isMissing())
- {
- WorkflowFileValueBean wf = new WorkflowFileValueBean();
- wf.setName( myFile.getFileName() );
- wf.setTitle( attachURL + "/" + myFile.getFileName() );
- wf.setDescription( myFile.getFileName() );
- c.add(wf);
- }
- }
- pvb.setFiles(c);
- }
- if( request.getParameter("type") !=null && Integer.parseInt( request.getParameter("type") ) == 2 ) //删除文件
- {
- //保存已有信息
- if( request.getParameter("title") != null )
- pvb.setTitle( request.getParameter("title") );
- if( request.getParameter("planBeginDateS") != null && !request.getParameter("planBeginDateS").equals("") )
- pvb.setPlanBeginDateS( request.getParameter("planBeginDateS") );
- if( request.getParameter("planEndDateS") != null && !request.getParameter("planEndDateS").equals("") )
- pvb.setPlanEndDateS( request.getParameter("planEndDateS") );
- if( request.getParameter("description") != null )
- pvb.setDescription( request.getParameter("description") );
- if( request.getParameter("templateId") != null )
- pvb.setTemplateId( Integer.valueOf( request.getParameter("templateId") ).intValue() );
- if( request.getParameterValues("stepNos") != null )
- pvb.setStepNos( request.getParameterValues("stepNos") );
- String files[] = request.getParameterValues("attachments");
- if(files!= null)
- {
- for(int i = 0; i<files.length; i++)
- {
- SubPathGenerater.deleteFile( root + SubPathGenerater.getSeperator() + files[i] );
- pvb.removeFile( files[i] );
- }
- }
- }
- %>