summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/file/src/Validation/Constraint/UploadedFileConstraint.php
blob: 3c08487d08f83c7aa119ccc98544a19d7153e62f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php

declare(strict_types=1);

namespace Drupal\file\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * A constraint for UploadedFile objects.
 */
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.';

}