HI,
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"/>
</jsp:useBean>
<%
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");
}
else
{
out.println("No uploaded files");
}
}
else out.println(" todo="+todo);
}
%>
Select a file to upload :
HTML tags used in this form :
<form
method="post"
action="add.jsp"
name="upload"
enctype="multipart/form-data">
<input
type="file"
name="uploadfile"
size="50">
Copyright
© 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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...