You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Nathan King <nk...@yahoo.com> on 2010/12/04 18:29:50 UTC
FileItem write method writes file and throws exception
Hi all,
I'm using FileItem's write method to write a file to disk. Oddly, the method
will write the file to disk, but then throw an exception. I'm catching the
exception and logging it; however, the exception message is "null." Anyone know
what could be the problem and how to resolve it? Below is the code. Thanks.
...
...
if (!fileItem.isFormField()) {
try {
fileItem.write(uploadedFile);
} catch (Exception e) {
logger.error("File upload failed. " + e.getMessage());
}
}
-Nate