[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - upload file portlet on jboss...help

raffaele.letizia do-not-reply at jboss.com
Fri Jan 30 05:57:24 EST 2009

i'm a new. I want to create a portlet that upload file... i have found a simpleupload.jsp with usebeans but i have problme because i can search the file but don't upload.
the text is:

<%@ page language="java" import="javazoom.upload.*,java.util.*" %>
<%@ page errorPage="ExceptionHandler.jsp" %>

<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
  <jsp:setProperty name="upBean" property="folderstore" value="Users/raffaele/Uploads"/>

      if (MultipartFormDataRequest.isMultipartFormData(request))
         // Uses MultipartFormDataRequest to parse the HTTP request.
         MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
         String todo = null;
         if (mrequest != null) todo = mrequest.getParameter("todo");
	     if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
                Hashtable files = mrequest.getFiles();
                if ( (files != null) && (!files.isEmpty()) )
                    UploadFile file = (UploadFile) files.get("uploadfile");
                    if (file != null) out.println("Form field : uploadfile"+" Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+" Content Type : "+file.getContentType());
                    // Uses the bean now to store specified by jsp:setProperty at the top.
                    upBean.store(mrequest, "uploadfile");
                  out.println("No uploaded files");
         else out.println(" todo="+todo);

      Select a file to upload :
              HTML tags used in this form : 
              name=&quot;upload&quot; enctype=&quot;multipart/form-data&quot;&gt;
    &copy; JavaZOOM 1999-2006

Where is the problem? Can we help me?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205823#4205823

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205823

More information about the jboss-user mailing list