String DESTINATIONDIR = "e://temp//";
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (!isMultipart) {
} else {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = null;
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
e.printStackTrace();
}
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if (item.isFormField()) {
} else {
try {
String itemName = item.getName();
File savedFile = new File(DESTINATIONDIR+itemName);
item.write(savedFile);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
[Message sent by forum member 'arckjmaster' (arckjmaster)]
http://forums.java.net/jive/thread.jspa?messageID=213233