code: protected boolean processStream(MultipartRequestInputStream input) throws IOException {
  		if (!isAllowedExtension()) {
  			// 非允许的扩展名
  			log.debug("Forbidden uploaded file [{}]", this.getFileName());
  			size = input.skipToBoundary();
  			return false;
  		}
  		size = 0;
  
  		// 处理内存文件
  		int memoryThreshold = setting.memoryThreshold;
  		if (memoryThreshold > 0) {
  			ByteArrayOutputStream baos = new ByteArrayOutputStream(memoryThreshold);
  			int written = input.copy(baos, memoryThreshold);
  			data = baos.toByteArray();
  			if (written <= memoryThreshold) {
  				// 文件存放于内存
  				size = data.length;
  				return true;
  			}
  		}
  
  		// 处理硬盘文件
  		tempFile = FileUtil.createTempFile(TMP_FILE_PREFIX, TMP_FILE_SUFFIX, FileUtil.touch(setting.tmpUploadPath), false);
  		BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile));
  		if (data != null) {
  			size = data.length;
  			out.write(data);
  			data = null; // not needed anymore
  		}
  		int maxFileSize = setting.maxFileSize;
  		try {
  			if (maxFileSize == -1) {
  				size += input.copy(out);
  				return true;
  			}
  			size += input.copy(out, maxFileSize - size + 1); // one more byte to detect larger files
  			if (size > maxFileSize) {
  				// 超出上传大小限制
  				tempFile.delete();
  				tempFile = null;
  				log.debug("Upload file [{}] too big, file size > [{}]", this.getFileName(), maxFileSize);
  				input.skipToBoundary();
  				return false;
  			}
  		} finally {
  			IoUtil.close(out);
  		}
  		// if (getFileName().length() == 0 && size == 0) {
  		// size = -1;
  		// }
  		return true;
  	}
docs: 处理上传表单流，提取出文件
  
  @param input 上传表单的流
  @throws IOException