parse(UploadRequest)
returning no items?
There are two common causes for this error.
Firstly, it might simply mean that you do not have the Commons IO
jar in your classpath. DiskFileUpload depends on IO (see
dependencies) - you can tell if
this is the case if the missing class is within the
org.apache.commons.io
package.
Secondly this can happen when attempting to rely on a shared copy of the Commons FileUpload jar file provided by your web container. The solution is to include the FileUpload jar file as part of your own web application, instead of relying on the container. The same may hold for FileUpload's IO dependency.
FileItem.getFileName()
return the whole path,
and not just the file name?
String fileName = item.getName(); if (fileName != null) { filename = FilenameUtils.getName(filename); }