class UploadedFileConstraint
A constraint for UploadedFile objects.
Hierarchy
- class \Drupal\file\Validation\Constraint\UploadedFileConstraint extends \Symfony\Component\Validator\Constraint
 
Expanded class hierarchy of UploadedFileConstraint
1 file declares its use of UploadedFileConstraint
- FormUploadedFile.php in core/
modules/ file/ src/ Upload/ FormUploadedFile.php  
File
- 
              core/
modules/ file/ src/ Validation/ Constraint/ UploadedFileConstraint.php, line 12  
Namespace
Drupal\file\Validation\ConstraintView source
class UploadedFileConstraint extends Constraint {
  
  /**
   * The upload max size. Defaults to checking the environment.
   *
   * @var int|null
   */
  public ?int $maxSize;
  
  /**
   * The upload ini size error message.
   *
   * @var string
   */
  public string $uploadIniSizeErrorMessage = 'The file %file could not be saved because it exceeds %maxsize, the maximum allowed size for uploads.';
  
  /**
   * The upload form size error message.
   *
   * @var string
   */
  public string $uploadFormSizeErrorMessage = 'The file %file could not be saved because it exceeds %maxsize, the maximum allowed size for uploads.';
  
  /**
   * The upload partial error message.
   *
   * @var string
   */
  public string $uploadPartialErrorMessage = 'The file %file could not be saved because the upload did not complete.';
  
  /**
   * The upload no file error message.
   *
   * @var string
   */
  public string $uploadNoFileErrorMessage = 'The file %file could not be saved because the upload did not complete.';
  
  /**
   * The generic file upload error message.
   *
   * @var string
   */
  public string $uploadErrorMessage = 'The file %file could not be saved. An unknown error has occurred.';
}
Members
| Title Sort descending | Modifiers | Object type | Summary | 
|---|---|---|---|
| UploadedFileConstraint::$maxSize | public | property | The upload max size. Defaults to checking the environment. | 
| UploadedFileConstraint::$uploadErrorMessage | public | property | The generic file upload error message. | 
| UploadedFileConstraint::$uploadFormSizeErrorMessage | public | property | The upload form size error message. | 
| UploadedFileConstraint::$uploadIniSizeErrorMessage | public | property | The upload ini size error message. | 
| UploadedFileConstraint::$uploadNoFileErrorMessage | public | property | The upload no file error message. | 
| UploadedFileConstraint::$uploadPartialErrorMessage | public | property | The upload partial error message. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.