Originally Posted by
mr.miku
Hi,
Please check the code bellow for servlet if that can help you:
f (ServletFileUpload.isMultipartContent(request)) {
ServletFileUpload servletFileUpload = new ServletFileUpload(
new DiskFileItemFactory());
List multiParts = servletFileUpload.parseRequest(request);
FileItem fileItem = null;
Iterator iterator = multiParts.iterator();
while (iterator.hasNext()) {
try {
fileItem = (FileItem) iterator.next();
logger.debug("File item - " + fileItem.getFieldName());
if (fileItem.isFormField()) {
if (fileItem.getFieldName().equals("param")) {
}
}else{
//write code for file
}
How is that better than simply sending them to the tutorial that contains pretty much identical code, as well as links to the libraries required to run it?