Project

General

Profile

Actions

Bug #105532

closed

FileUpload: Not all options from MimeTypeValidator can be set

Added by Jörg Hofrichter 21 days ago. Updated 18 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
-
Start date:
2024-11-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The MimeTypeValidator offers the following options:

  • allowedMimeTypes
  • ignoreFileExtensionCheck
  • notAllowedMessage
  • invalidExtensionMessage

However, when using the FileUpload annotation, only the first option is actually passed to the MimeTypeValidator.

Example:

    #[Extbase\FileUpload([
        'validation' => [
            'required' => false,
            'fileSize' => ['minimum' => '0K', 'maximum' => '8M'],
            'allowedMimeTypes' => ['image/png'],
            'ignoreFileExtensionCheck' => True,
            'notAllowedMessage' => 'LLL:EXT:dummy/Resources/Private/Language/locallang.xlf:validation.mimetype.notAllowedMessage',
            'invalidExtensionMessage' => 'LLL:EXT:dummy/Resources/Private/Language/locallang.xlf:validation.mimetype.invalidextension',
         ],
        'uploadFolder' => '1:/user_upload/extbase_multiple_files/',
    ])]
    protected ObjectStorage $files;
 
Actions

Also available in: Atom PDF