class InputStreamUploadedFile
An uploaded file from an input stream.
Hierarchy
- class \Drupal\file\Upload\InputStreamUploadedFile implements \Drupal\file\Upload\UploadedFileInterface
 
Expanded class hierarchy of InputStreamUploadedFile
2 files declare their use of InputStreamUploadedFile
- FileUpload.php in core/
modules/ jsonapi/ src/ Controller/ FileUpload.php  - FileUploadResource.php in core/
modules/ file/ src/ Plugin/ rest/ resource/ FileUploadResource.php  
File
- 
              core/
modules/ file/ src/ Upload/ InputStreamUploadedFile.php, line 12  
Namespace
Drupal\file\UploadView source
final class InputStreamUploadedFile implements UploadedFileInterface {
  
  /**
   * Creates a new InputStreamUploadedFile.
   */
  public function __construct(protected readonly string $clientOriginalName, protected readonly string $filename, protected readonly string $realPath, protected readonly int|false $size) {
  }
  
  /**
   * {@inheritdoc}
   */
  public function getClientOriginalName() : string {
    return $this->clientOriginalName;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getSize() : int {
    return $this->size;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getRealPath() : string|false {
    return $this->realPath;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getFilename() : string {
    return $this->filename;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getPathname() : string {
    throw new \BadMethodCallException(__METHOD__ . ' not implemented');
  }
  
  /**
   * {@inheritdoc}
   */
  public function isValid() : bool {
    throw new \BadMethodCallException(__METHOD__ . ' not implemented');
  }
  
  /**
   * {@inheritdoc}
   */
  public function getErrorMessage() : string {
    throw new \BadMethodCallException(__METHOD__ . ' not implemented');
  }
  
  /**
   * {@inheritdoc}
   */
  public function getError() : int {
    throw new \BadMethodCallException(__METHOD__ . ' not implemented');
  }
  
  /**
   * {@inheritdoc}
   */
  public function validate(ValidatorInterface $validator, array $options = []) : ConstraintViolationListInterface {
    return new ConstraintViolationList();
  }
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.