Repository navigation
Description
Description
Folders can has restriction on which kind of files can be added to them. You can find it on the fileMasks property, you will recieve an string with a comma separated list of allowed file extensions: "*.pdf,*.jpg".
We can use this to prevent negative workflows when adding files to Content Drive.
Since that string can have any file extension and can be unrelated between them, as you see in the example it accepts PDF and JPG Images.
If we have a fileMasks property, we need to filter Image and Video options from the dropdown and only leave File and Asset.
Otherwise if fileMasks is empty, we need all options available.
Technical assets
You can make use of:
GET /api/v1/folder/<folder-id>
Inside the map you will find the fileMasks
You can obtain the folder identifier from the Selected Node on the store
Example response:
{
"entity": {
"defaultFileType": "33888b6f-7a8e-4069-b1b6-5c1aa9d0a48d",
"filesMasks": "*.pdf,*.jpg",
"host": {
"aliases": "localhost\n127.0.0.1",
"archived": false,
"categoryId": "a1de7e5c-d4b4-43ab-866c-98845673fb74",
"contentTypeId": "855a2d72-f2f3-4169-8b04-ac5157c4380c",
"default": true,
"dotAsset": false,
"fileAsset": false,
"folder": "SYSTEM_FOLDER",
"form": false,
"host": "SYSTEM_HOST",
"hostThumbnail": null,
"hostname": "demo.dotcms.com",
"htmlpage": false,
"identifier": "48190c8c-42c4-46af-8d1a-0cd5db894797",
"indexPolicyDependencies": "DEFER",
"inode": "a1de7e5c-d4b4-43ab-866c-98845673fb74",
"keyValue": false,
"languageId": 1,
"languageVariable": false,
"live": true,
"locked": true,
"lowIndexPriority": false,
"modDate": 1726154781278,
"modUser": "dotcms.org.1",
"name": "demo.dotcms.com",
"new": false,
"owner": "dotcms.org.1",
"parent": true,
"permissionId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
"permissionType": "com.dotmarketing.portlets.contentlet.model.Contentlet",
"persona": false,
"sortOrder": 0,
"structureInode": "855a2d72-f2f3-4169-8b04-ac5157c4380c",
"systemHost": false,
"tagStorage": "SYSTEM_HOST",
"title": "demo.dotcms.com",
"titleImage": null,
"type": "contentlet",
"vanityUrl": false,
"variantId": "DEFAULT",
"versionId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
"working": true
},
"hostId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
"idate": 1687459956505,
"identifier": "c7eb5d4e72030ba98d6b78d2d2279cf8",
"inode": "c7eb5d4e72030ba98d6b78d2d2279cf8",
"map": {
"defaultFileType": "33888b6f-7a8e-4069-b1b6-5c1aa9d0a48d",
"filesMasks": "*.pdf,*.jpg", <- HERE IS THE PROP YOU NEED
"hostId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
"iDate": 1687459956505,
"identifier": "c7eb5d4e72030ba98d6b78d2d2279cf8",
"inode": "c7eb5d4e72030ba98d6b78d2d2279cf8",
"modDate": 1758659955802,
"name": "block-editor",
"owner": null,
"path": "/application/block-editor/",
"showOnMenu": false,
"sortOrder": 0,
"title": "block-editor",
"type": "folder"
},
"modDate": 1758659955802,
"name": "block-editor",
"owner": null,
"parent": true,
"path": "/application/block-editor/",
"permissionType": "com.dotmarketing.portlets.folders.model.Folder",
"showOnMenu": false,
"sortOrder": 0,
"systemFolder": false,
"title": "block-editor",
"type": "folder"
},
"errors": [],
"i18nMessagesMap": {},
"messages": [],
"pagination": null,
"permissions": []
}Acceptance Criteria
- Dropdown should show the according available options
- Dropdown should not be active until we have the necessary info to filter the options or add a loading state
- Root should allow any file, so no filter on the dropdown
Priority
High
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][TASK] Filter Add New Dropdown by current folder `allowedFileExtensions`[/-][+][TASK] Filter `Add New` Dropdown by current folder `allowedFileExtensions`[/+][-][TASK] Filter `Add New` Dropdown by current folder `allowedFileExtensions`[/-][+][TASK] Filter `Add New` Dropdown by current folder `fileMasks`[/+]zJaaal commentedon Oct 15, 2025
We are going to work on other ticket