%@ page import="org.baraza.web.*" %> <% ServletContext context = getServletContext(); String dbconfig = "java:/comp/env/jdbc/database"; String ps = System.getProperty("file.separator"); String title = context.getInitParameter("web_title"); String xmlcnf = (String)session.getAttribute("xmlcnf"); String xmlfile = context.getRealPath("WEB-INF") + ps + "configs" + ps + xmlcnf; String userIP = request.getRemoteAddr(); String userName = request.getRemoteUser(); BWeb web = new BWeb(dbconfig, xmlfile); web.setUser(userIP, userName); web.init(request); String pictureFile = null; String field = request.getParameter("field"); String upload = request.getParameter("upload"); String contentType = request.getContentType(); if (contentType != null) { if (contentType.indexOf("multipart/form-data") >= 0) { pictureFile = web.receivePhoto(request); System.out.println("BASE 4040 : " + pictureFile); } } %> <%@ include file="/resources/include/init.jsp" %>
<% if(pictureFile == null) { %> <% } else { %> <% } %>