hi

i just cant understnd why simple file upload is not working.

here is my code:

upload.jsp
=======
<html>
<head>
<title>Upload a file please</title>
</head>

<h1>Please upload a file</h1>
<form name="upload_ form" enctype="multipart/ form-data" method="post" action=http://mail.yahoo.com/config/login?/"/test/ upload.do">
<center>
<font face="tahoma" size="3">
Please choose a file to upload <input type="file" name="upload_ file">
<hr>
<input type="submit" name="bttn_submit" value="Upload File">
</font>
</center>
</form>

</html>
------------ --------- ---------

FileUploadServlet. java
============ ===
public void doPost (HttpServletRequest req,HttpServletResp onse res)throws ServletException, IOException{

// first check if the upload request coming in is a multipart request
boolean isMultipart = ServletFileUpload. isMultipartConte nt(req);

System.out.println( req.getContentTy pe());


// Create a factory for disk-based file items
FileItemFactory factory = new DiskFileItemFactory ();

// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload( factory);

// Parse the request
List items=null;
try {
items = upload.parseRequest (req);
} catch (FileUploadExceptio n e) {
// TODO Auto-generated catch block
e.printStackTrace( );
}

// Process the uploaded items
Iterator iter = items.iterator( );
while (iter.hasNext( )) {
FileItem item = (FileItem) iter.next();

// if (item.isFormField( )) {
// processFormField( item);
// } else {
// processUploadedFile (item);
// }
}


}

my problem is on the bold line. items = upload.parseRequest (req);
this method return a list which is empty!

very strange problem! so pls help me!

i copied this sample code from jakarta web site. but their code is not working!

i am using commonfileupload 1.1.1 jar file.

--chinmoy