code: public static void uploadFileItems(final List<FileItem> fileItems, final Map<String, String[]> parameters,
  			final Map<String, FileItem[]> files) {
  
  		for (FileItem item : fileItems) {
  			String name = item.getFieldName();
  			boolean formField = item.isFormField();
  
  			if (LOG.isDebugEnabled()) {
  				LOG.debug(
  						"Uploading form " + (formField ? "field" : "attachment") + " \"" + name + "\"");
  			}
  
  			if (formField) {
  				String value;
  				try {
  					// Without specifying UTF-8, apache commons DiskFileItem defaults to ISO-8859-1.
  					value = item.getString("UTF-8");
  				} catch (UnsupportedEncodingException e) {
  					throw new SystemException("Encoding error on formField item", e);
  				}
  				RequestUtil.addParameter(parameters, name, value);
  			} else {
  				// Form attachment
  				RequestUtil.addFileItem(files, name, item);
  				String value = item.getName();
  				RequestUtil.addParameter(parameters, name, value);
  			}
  		}
  
  	}
docs: <p>
  {@link FileItem} classes (if attachements) will be kept as part of the request. The default behaviour of the file
  item is to store the upload in memory until it reaches a certain size, after which the content is streamed to a
  temp file.</p>
  
  <p>
  If, in the future, performance of uploads becomes a focus we can instead look into using the Jakarta Commons
  Streaming API. In this case, the content of the upload isn't stored anywhere. It will be up to the user to
  read/store the content of the stream.</p>
  
  @param fileItems a list of {@link FileItem}s corresponding to POSTed form data.
  @param parameters the map to store non-file request parameters in.
  @param files the map to store the uploaded file parameters in.