public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		resp.setContentType("text/plain");

		try {
			// Get the image representation
		    ServletFileUpload upload = new ServletFileUpload();
		    FileItemIterator iter = upload.getItemIterator(req);

			ExcelHandler parser = null;
		    while (iter.hasNext()) {
			    FileItemStream item = iter.next();
			    
			    if (item.isFormField()) {
			    	if (item.getFieldName().equals("filetype")) {
			    		String fileType = getFieldValue(item);			    		

			    		if (fileType.equals("who")) {
			    			parser = new WHOExcelHandler();
			    		} else if (fileType.equals("country")) {
			    			parser = new UNICEFCountryExcelHandler();
			    		} else if (fileType.equals("unicef")) {
			    			parser = new UNICEFExcelHandler();
			    		} else {
			    			resp.getWriter().println("ERROR: Invalid file type. Please try again.");
			    		}
			    	}
			    }
			    
		    	if (!item.isFormField()) {
		    		if (parser != null) {
					    int numberOfPersistedItems = parseAndPersistData(parser, item);
						resp.sendRedirect("codetest.jsp");
		    		} else {
		    			LOGGER.log(Level.SEVERE, "ERROR: Couldn't determine file type.");
		    			break;
		    		}
		    	}
		    }
		} catch (FileUploadException e) {
			LOGGER.log(Level.SEVERE, "ERROR: Couldn't upload file.", e);
			resp.getWriter().println("ERROR: Couldn't upload file.");
		} catch (Exception e) {
			LOGGER.log(Level.SEVERE, "ERROR: Couldn't parse file.", e);
			resp.getWriter().println("ERROR: Couldn't parse file.");
		}
	}