<%@ include file="bbb_api.jsp"%> <%@ include file="demo_header.jsp"%>

Demo #5: Upload a presentation before joining a Course...

  Full Name:  
  Upload File:  
     
<%@ page import="java.util.List" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.io.File" %> <%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%> <%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%> <%@ page import="org.apache.commons.fileupload.*"%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@page import="sun.security.provider.SHA"%> <%@page import="org.apache.commons.codec.binary.Base64"%> <%@page import="java.security.MessageDigest"%> <% String uname=""; boolean isMultipart = ServletFileUpload.isMultipartContent(request); if (!isMultipart) { } else { FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = null; try { items = upload.parseRequest(request); } catch (FileUploadException e) { e.printStackTrace(); } out.print(items.size()); Iterator itr = items.iterator(); while (itr.hasNext()) { FileItem item = (FileItem) itr.next(); String xml = null; xml = " "; if (item.isFormField()) { String name = item.getFieldName(); String value = item.getString(); if(name.equals("username")) { uname=value; } } else { try { String itemName = item.getName(); if(itemName==""){ xml = " "; } else { byte[] b = item.get(); String encoded = Base64.encodeBase64String(b); xml = " "+encoded+"\" "; } } catch (Exception e) { e.printStackTrace(); } String joinURL = getJoinURLXML(uname, "Demo Meeting", "Presentation should be uploaded. It was uploaded as an encoded file", xml ); if (joinURL.startsWith("http://")) { %>

Your presentation has been Uploaded

<% } else { %> Error: getJoinURL() failed

<%=joinURL %> <% } } } } %>