Added a contraint to check for empty file upload.
2 unresolved threads
2 unresolved threads
Closes #3345450
Changes:
- Added a validation constraint which checks if the uploaded file size is of zero bytes
Merge request reports
Activity
8 * Zero Byte File constraint. 9 * 10 * @Constraint( 11 * id = "RestrictZeroByteFile", 12 * label = @Translation("Restrict zero byte file", context = "Validation"), 13 * type = "file" 14 * ) 15 */ 16 class RestrictZeroByteFileConstraint extends Constraint { 17 18 /** 19 * The message for when a empty file is uploaded. 20 * 21 * @var string 22 */ 23 public string $zeroByteFileMessage = 'The uploaded is empty! Please upload a valid file.'; changed this line in version 3 of the diff
4 5 use Symfony\Component\Validator\Constraint; 6 7 /** 8 * Zero Byte File constraint. 9 * 10 * @Constraint( 11 * id = "RestrictZeroByteFile", 12 * label = @Translation("Restrict zero byte file", context = "Validation"), 13 * type = "file" 14 * ) 15 */ 16 class RestrictZeroByteFileConstraint extends Constraint { 17 18 /** 19 * The message for when a empty file is uploaded. changed this line in version 3 of the diff
added 14 commits
-
7a4e49a4...a9865eb3 - 12 commits from branch
project:11.x
- e5a061dd - Added a contraint to check for empty file upload.
- 739bdcc6 - Merge remote-tracking branch 'drupal-3345450/3345450-restrict-the-upload' into...
-
7a4e49a4...a9865eb3 - 12 commits from branch
added 1 commit
- 52b63667 - Rename class to match with other constraint class. Add tests. Improve message.
Please register or sign in to reply