code: public File partsFirstFile(final File home, final long max, final String filenameReg, final String contentTypeReg) throws IOException {
          if (!isMultipart()) return null;
          File tmpfile = null;
          boolean has = false;
          for (MultiPart part : parts()) {
              if (has) continue; //不遍历完后面getParameter可能获取不到值
              has = true;
              if (filenameReg != null && !filenameReg.isEmpty() && !part.getFilename().matches(filenameReg)) continue;
              if (contentTypeReg != null && !contentTypeReg.isEmpty() && !part.getContentType().matches(contentTypeReg)) continue;
              File file = new File(home, "tmp/redkale-" + System.nanoTime() + "_" + part.getFilename());
              File parent = file.getParentFile();
              if (!parent.isDirectory()) parent.mkdirs();
              boolean rs = part.save(max < 1 ? Long.MAX_VALUE : max, file);
              if (!rs) {
                  file.delete();
                  parent.delete();
              } else {
                  tmpfile = file;
              }
          }
          return tmpfile;
      }
docs: 获取第一个文件
  
  @param home           进程目录
  @param max            可接收的文件大小最大值
  @param filenameReg    可接收的文件名正则表达式
  @param contentTypeReg 可接收的ContentType正则表达式
  
  @return 文件
  @throws IOException IOException