code: protected String getFilename(HttpServletRequest request,
        HttpServletResponse response) throws IOException {
      final String filename = request.getParameter("filename");
      if (filename == null || filename.length() == 0) {
        throw new IOException("Invalid filename");
      }
      return filename;
    }
docs: Get filename from the request