#103594Allow specific file extensions per File Storage
Description
- Documents (/fileadmin/documents/*)
- Images (/fileadmin/images/*)
- Documents (.pdf, .doc, .docx, .etc…)
- Images (.jpg, .jpeg, .png, .gif, .webp, .etc…)
I’ve created a simple BeforeFileAddedEvent listener (which I’m attaching here as an example). Below is a sample PageTS Config on the Page ID 1 Resources tab or on the user or user group Options tab:
permissions.file.storage {
// 1 = Images Storage ID
1 {
allowedExtensions = jpg|jpeg|png|webp|gif|svg
allowedExtensionsMsg = To upload a document, please use the Documents drive.
}
// 5 = Documents Storage ID
5 {
allowedExtensions = pdf|docx|doc|csv|xlsx|xls|pptx|ppt
allowedExtensionsMsg = To upload an image, please use the Images drive.
}
}
Is it doable to include something similar in the core of TYPO3?
Thanks!
Reviews 1
Related issues 1
Files 1
History 517
-
Mathias Bolt Lesniak commented <span data-processor="relativetime" data-value="2024-04-11T06:09:52+00:00" > 04/11/24, 06:09 </span>
-
Marcelo Vetter commented <span data-processor="relativetime" data-value="2024-04-12T04:15:47+00:00" > 04/12/24, 04:15 </span>
Hi Mathias,
That’s just a proof of concept as you mentioned.
I didn’t search a way to add it directly to the File Storage record or even via TypoScript. If the configuration is done directly in the File Storage settings, that would be fine with me, and it makes a lot more sense!
However, having the flexibility to configure it per user or user groups would be for convenience in the future. In my situation, I might allow some users to upload videos as well in the Image/Media storage. All other users could only upload images.
Cheers!
- Marcelo -
Mathias Bolt Lesniak commented <span data-processor="relativetime" data-value="2024-04-12T07:24:10+00:00" > 04/12/24, 07:24 </span>
Cool! I get you. 👍
-
Gerrit Code Review pushed patch set 1 for main to change 96681 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-14T13:22:35+00:00" > 10/14/26, 13:22 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-16T16:24:03+00:00" > 10/16/26, 16:24 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-17T07:47:07+00:00" > 10/17/26, 07:47 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-19T09:43:23+00:00" > 10/19/26, 09:43 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-19T10:35:32+00:00" > 10/19/26, 10:35 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-19T16:28:47+00:00" > 10/19/26, 16:28 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-19T16:31:39+00:00" > 10/19/26, 16:31 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-20T19:30:34+00:00" > 10/20/26, 19:30 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-21T08:44:44+00:00" > 10/21/26, 08:44 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-21T08:49:45+00:00" > 10/21/26, 08:49 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-21T19:26:52+00:00" > 10/21/26, 19:26 </span>
-
Gerrit Code Review pushed patch set 12 for main to change 96681 <span data-processor="relativetime" data-value="2026-10-24T20:29:33+00:00" > 10/24/26, 20:29 </span>
-
Oliver Bartsch commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-29T17:30:18+00:00" > 10/29/26, 17:30 </span>Applied in changeset commit:20514713728f9de708889d998cec1c0725f9d8d6.
-
Georg Ringer changed Related to #102644 <span data-processor="relativetime" data-value="2026-11-10T18:40:04+00:00" > 11/10/26, 18:40 </span>
Hi Marcelo!
Thank you for posting this, and for including a proof of concept PHP file!
I wonder about the use case for this and the reason for placing the configuration within PageTS or UserTS. Couldn’t this configuration also be placed within the File Storage record? Or is it a specific requirement that the allowed files can be changed depending on the user or page?
— Mathias