// Parse the request.
try {
@SuppressWarnings("unchecked")
List<FileItem> items = upload.parseRequest(request);
AttachmentId id = null;
String waveRefStr = null;
FileItem fileItem = null;
for (FileItem item : items) {
// Process only file upload - discard other form item types.
if (item.isFormField()) {