protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		boolean isMultipartContent = ServletFileUpload
				.isMultipartContent(request);
		if (request.isUserInRole("admin")
				|| request.isUserInRole("responsible")) {

			if (!isMultipartContent) {
				response.sendRedirect("error.html");
				logger.warn("request is not multipart, unexpected. Request by: "
						+ request.getRemoteUser());
				return;
			}
			FileItemFactory factory = new DiskFileItemFactory();
			ServletFileUpload upload = new ServletFileUpload(factory);
			try {
				List<FileItem> fields = upload.parseRequest(request);
				Iterator<FileItem> it = fields.iterator();
				if (fields.size() != 2) {
					response.sendRedirect("addusers.html?success=false");
					logger.warn("Fields size not 2, unexpected. Request by: "
							+ request.getRemoteUser());
					return;
				}
				FileItem fileitem = it.next();
				if (fileitem.getSize() > 1024 * 1024) {
					response.sendRedirect("addusers.html?success=false");
					logger.warn("File larger than 1MB. Request by: "
							+ request.getRemoteUser());
					return;
				}
				if (!fileitem.getName().endsWith(".csv")) {
					response.sendRedirect("addusers.html?success=false");
					logger.warn("Incorrect file type. Request by: "
							+ request.getRemoteUser());
					return;
				}

				String course = it.next().getString();
				logger.info("Starting aading users via CSV. Request by: " + request.getRemoteUser());
				if (AddUsersToSql(fileitem.getInputStream(), course)) {
					logger.info("User addation succeeded");
				}

			} catch (FileUploadException e) {
				logger.error("File upload exception. Request by: " + request.getRemoteUser(), e);
				return;
			}
			response.sendRedirect("addusers.html?success=true");
		}
		else{
			logger.warn("Unauthorized access by: " + request.getRemoteUser());
			response.sendRedirect("logout");
			return;
		}
	}