code: @Override
      public void uploadStarted(final StartedEvent event) {
          // reset internal state here because instance is reused for next upload!
          resetState();
  
          final SoftwareModule softwareModule = getSelectedSoftwareModule();
  
          this.fileUploadId = new FileUploadId(event.getFilename(), softwareModule);
  
          if (getUploadState().isFileInUploadState(this.fileUploadId)) {
              // actual interrupt will happen a bit late so setting the below
              // flag
              interruptUploadDueToDuplicateFile();
              event.getUpload().interruptUpload();
          } else {
              LOG.info("Uploading file {}", fileUploadId);
              publishUploadStarted(fileUploadId);
  
              if (RegexCharacterCollection.stringContainsCharacter(event.getFilename(), ILLEGAL_FILENAME_CHARACTERS)) {
                  LOG.info("Filename contains illegal characters {} for upload {}", fileUploadId.getFilename(),
                          fileUploadId);
                  interruptUploadDueToIllegalFilename();
                  event.getUpload().interruptUpload();
              } else if (isFileAlreadyContainedInSoftwareModule(fileUploadId, softwareModule)) {
                  LOG.info("File {} already contained in Software Module {}", fileUploadId.getFilename(), softwareModule);
                  interruptUploadDueToDuplicateFile();
                  event.getUpload().interruptUpload();
              }
          }
      }
docs: Upload started for {@link Upload} variant.
  
  @see com.vaadin.ui.Upload.StartedListener#uploadStarted(com.vaadin.ui.Upload.StartedEvent)