commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Awais Ahamed Bajwa" <awais.ba...@emirates.com>
Subject Size of the list containing file items is null.
Date Fri, 27 Apr 2007 19:55:33 GMT
Hi folks,


I have a JSP containing five ITEMs, 

Here is some code of the JSP:

FORM:
<form name="frmPR" method="post"  action="/upload/servlet/UploadServlet"
id="frmPR" enctype="multipart/form-data">

FILE ITEMS: 
 <input name="document" id="document" type="file" class="textbox"/>  I
have five items.


Here is my servlet code:

			File repositoryPath=null; 
a				List uploadedFiles=new ArrayList();
				HttpSession session =
request.getSession(true);
				StringBuffer errors=new StringBuffer();
			if
(!ServletFileUpload.isMultipartContent(request)){
	
response.sendError(HttpServletResponse.SC_NO_CONTENT);
				}
				ServletFileUpload servletFileUpload =
new ServletFileUpload(new DiskFileItemFactory());
				DiskFileItemFactory diskFileItemFactory
= new DiskFileItemFactory();
	
diskFileItemFactory.setSizeThreshold(40960); /* the unit is bytes */
				List fileItemsList = null;
				
				repositoryPath = new
File(Configurations.getRootFileLocation());
	
diskFileItemFactory.setRepository(repositoryPath);
	
servletFileUpload.setSizeMax(Configurations.getMaximumFileSize()); /*
the unit is bytes */

				try {
				fileItemsList =
servletFileUpload.parseRequest(request);






When I  check the above FileItemList, it returns me the size equal to 0


AM I Missing something:?????



Regards
Awais Bajwa









Regards

Awais Bajwa

Sr Software Engineer
MERCATOR - the IT division of the Emirates Group
Emirates Aviation College- First Floor Room 111 
DUBAI -United Arab Emirates
Tel:	+971-42-187997
Cell:	+971-50-8930159
awais.bajwa@emirates.com




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message