code: @Override
      public void onProgress(final StreamingProgressEvent event) {
          assertStateConsistency(fileUploadId, event.getFileName());
  
          if (event.getBytesReceived() > maxSize || event.getContentLength() > maxSize) {
              LOG.error("User tried to upload more than was allowed ({}).", maxSize);
              interruptUploadDueToFileSizeExceeded(maxSize);
              return;
          }
          if (isUploadInterrupted()) {
              return;
          }
  
          publishUploadProgressEvent(fileUploadId, event.getBytesReceived(), event.getContentLength());
      }
docs: Reports progress in {@link StreamVariable} variant. Interrupts
  
  @see com.vaadin.server.StreamVariable#onProgress(com.vaadin.server.StreamVariable.StreamingProgressEvent)