<%@include file="../../comm/init.txt"%><%@page import="kgweb.web.Frame;kgweb.bean.TForumfileBean"%><% TForumfileBean actionBean = new TForumfileBean(); Frame forumfileFrame = Frame.processSinglePageFrame(actionBean, out, session, request, _charsetName, /*request的参数*/ "id", "forumSubjectFile", "password"); // ExeEvent exeEvent = new ExeEvent(session, response, _thisFileName+'$'+$ke$sourceLineNumber, "javascript:history.go(-1)", actionBean ); //执行 int actionId = actionBean.getTForumfileById(); // if (actionId < 0) { //发生了错误 //根据执行结果进行跳转 exeEvent.action(actionId); return; } //没有发生错误则继续下去 kgweb.table.TForumfile_if forumfile = actionBean.getTforumfile(); //判断权限 boolean pass; if (forumfile.getAccesspsw() != null) { //need use password to visit it pass = forumfile.getAccesspsw().equals(actionBean.getPassword()); } else { //need check role pass = kgweb.role.WebRole.pass(forumfile.getAccessrole(), _roleId); } // if (!pass) { exeEvent.action(-1); return; } File downFile; if (actionBean.getForumSubjectFile() != null && actionBean.getForumSubjectFile()) { downFile = kgweb.bean.AttachmentFileBean.getForumsubjectFileSaveFolder(_bundle, forumfile.getAfilesavename()); } else { downFile = kgweb.bean.AttachmentFileBean.getForumcontentFileSaveFolder(_bundle, forumfile.getAfilesavename()); } if (!downFile.exists()) { exeEvent.action(-14); //附件不存在 return; } String filename = java.net.URLEncoder.encode(forumfile.getAfilename(), "UTF-8"); filename = filename.replace('+', ' '); if (true) { response.outBinFile(downFile, filename, "UTF-8"); return; }%><%@include file="../../comm/end.txt"%>