Search code examples
phptypo3typo3-9.xtypo3-extensions

How to restrict file types of files uploaded through TYPO3 Tca file upload field?


I have a file upload field in the TCA of an extension. I want to restrict the type of uploadable files through that field. Only "pdf" or any other document file types (Eg: doc,xls,rar,zip etc) must be uploaded in that field. All other file types must be prevented (Eg: image,video etc). How can I do that ?


Solution

  • You need to add the overrideChildTca and filter to your TCA configuration to override the allowed file extensions, like it is described on https://docs.typo3.org/m/typo3/reference-tca/9.5/en-us/ColumnsConfig/Type/Inline.html#file-abstraction-layer