// the part actually contained a file
// StringWriter sw = new StringWriter();
// long size = filePart.writeTo(new File(System
// .getProperty("java.io.tmpdir")));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
long size = filePart.writeTo(baos);
LOG.info("file; name=" + name + "; filename=" + fileName + ", filePath=" + filePart.getFilePath() + ", content type=" + filePart.getContentType() + ", size="
+ size);
out.print(String.format("%s: %s", name, new String(baos.toByteArray()).trim()));
} else {
// the field did not contain a file