{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-directory-upload",
  "framework": "javascript",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "directory-upload",
  "dependencies": [
    "@syncfusion/ej2-filemanager",
    "@syncfusion/ej2-splitbuttons"
  ],
  "description": "File manager with a toolbar dropdown to upload either individual files or a whole folder.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": true,
    "platformIndex": "https://ai.syncfusion.com/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/file-manager-directory-upload.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-directory-upload/file-manager.html",
      "content": "<div class=\"control-section\">\n    <div class=\"sample-container\">\n        <!-- Initialize FileManager -->\n        <div id=\"container\"></div>\n    </div>\n</div>\n"
    },
    {
      "target": "src/components/file-manager-directory-upload/file-manager.ts",
      "content": "import { FileManager, Toolbar, NavigationPane, DetailsView, ContextMenu } from '@syncfusion/ej2-filemanager';\nimport { DropDownButton, type ItemModel } from '@syncfusion/ej2-splitbuttons';\nFileManager.Inject(Toolbar, NavigationPane, DetailsView, ContextMenu);\n\n/**\n * File Manager folder upload sample\n */\nexport function initFileManagerDirectoryUpload(): void {\n    var buttonTemplate = '<button id=\"dropButton\" class=\"e-tbar-btn e-tbtn-txt\"> <span class=\"e-tbar-btn-text\">Upload</span> </button>';\n    let hostUrl: string = 'https://physical-service.syncfusion.com/';\n    let fileObject: FileManager = new FileManager({\n        ajaxSettings: {\n            url: hostUrl + 'api/FileManager/FileOperations',\n            getImageUrl: hostUrl + 'api/FileManager/GetImage',\n            uploadUrl: hostUrl + 'api/FileManager/Upload',\n            downloadUrl: hostUrl + 'api/FileManager/Download'\n        },\n        contextMenuSettings: {\n            file: [ \"Cut\", \"Copy\", \"|\", \"Delete\", \"Download\", \"Rename\", \"|\", \"Details\"],\n            visible: true\n        },\n        toolbarItems: [{ name: 'NewFolder' },\n            { template: buttonTemplate, name: 'Upload' },\n            { name: 'SortBy' },\n            { name: 'Refresh' },\n            { name: 'Cut' },\n            { name: 'Copy' },\n            { name: 'Paste' },\n            { name: 'Delete' },\n            { name: 'Download' },\n            { name: 'Rename' },\n            { name: 'Selection' },\n            { name: 'View' },\n            { name: 'Details' }],\n            success: onSuccess\n    });\n    fileObject.appendTo('#container');\n    function onSuccess() {\n        if (!document.getElementById('dropButton').classList.contains('e-dropdown-btn')) {\n            let items: ItemModel[] = [{ text: fileObject.localeObj.getConstant('Folder') }, { text: fileObject.localeObj.getConstant('File') }];\n            new DropDownButton({\n                    items: items,\n                    iconCss: 'e-icons e-fe-upload',\n                    select: (args) => {\n                        if (args.item.text === fileObject.localeObj.getConstant('Folder')) {\n                            fileObject.uploadSettings.directoryUpload = true;\n                        } else {\n                            fileObject.uploadSettings.directoryUpload = false;\n                        }\n                        setTimeout(function () {\n                            let uploadBtn: HTMLElement = document.querySelector('.e-file-select-wrap button');\n                            uploadBtn.click();\n                        }, 100);\n                    }\n            },'#dropButton');\n            document.getElementById('dropButton').onclick = function (args) {\n            args.stopPropagation();\n        };\n    }\n    }\n}\n"
    }
  ]
}