<%@page import="java.net.URLDecoder"%> <%@page import="com.amarsoft.are.jbo.impl.BizObjectTableMapper"%> <%@page import="com.amarsoft.awe.util.DBKeyHelp"%> <%@page import="com.amarsoft.awe.common.attachment.*"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/IncludeBegin.jsp"%><% AmarsoftUpload myAmarsoftUpload = new AmarsoftUpload(); myAmarsoftUpload.initialize(pageContext); myAmarsoftUpload.upload(); String id = (String)myAmarsoftUpload.getRequest().getParameter("attrid"); //文档编号 System.out.println("文档Id="+id); List list = JBOFactory.createBizObjectQuery("jbo.app.tenwa.doc.LB_DOCATTRIBUTE", "select * from O where id=:id ") .setParameter("id", id).getResultList(false); BizObject attchment=list.get(0); //定义数据库操作变量 SqlObject so = null; String sNewSql = ""; String sFileSaveMode = CurConfig.getConfigure("FileSaveMode"); String sFileSavePath = CurConfig.getConfigure("FileSavePath"); String sFileNameType = CurConfig.getConfigure("FileNameType"); if (!myAmarsoftUpload.getFiles().getFile(0).isMissing()){ try { if(sFileSaveMode.equals("Disk")){ //存放文件服务器中 String sFilePath=attchment.getAttribute("fullpath").getString(); System.out.println(sFilePath); myAmarsoftUpload.getFiles().getFile(0).saveAs(sFilePath); } if(sFileSaveMode.equals("Table")){ //存放数据表中 //myAmarsoftUpload.getFiles().getFile(0).fileToField(Sqlca,"update "+trueTable+" set DocContent=? where DocNo='"+sDocNo+"' and AttachmentNo='"+sAttachmentNo+"'"); } myAmarsoftUpload = null; }catch(Exception e){ myAmarsoftUpload = null; %> <% } } %> <%@ include file="/IncludeEnd.jsp"%>