{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-directory-upload",
  "framework": "angular",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "directory-upload",
  "dependencies": [
    "@syncfusion/ej2-angular-filemanager",
    "@syncfusion/ej2-angular-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/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/file-manager-directory-upload.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-directory-upload/file-manager.component.html",
      "content": "<div class=\"sample-container\">\n    <ejs-filemanager id='file' #fileObj [ajaxSettings]='ajaxSettings' [contextMenuSettings]=\"contextMenuSettings\" (success)=\"onSuccess()\" >\n      <e-toolbaritems>\n        <e-toolbaritem name=\"NewFolder\"></e-toolbaritem>\n        <e-toolbaritem name=\"Upload\">\n          <ng-template #template>\n            <button ejs-dropdownbutton id=\"dropButton\" [items]='items' cssClass=\"e-tbar-btn e-tbtn-txt\" iconCss=\"e-icons e-fe-upload\" (select)=\"onSelect($event)\"><span class=\"e-tbar-btn-text\">{{ uploadLabel }}</span></button>\n          </ng-template>\n        </e-toolbaritem>\n        <e-toolbaritem name=\"SortBy\"></e-toolbaritem>\n        <e-toolbaritem name=\"Refresh\"></e-toolbaritem>\n        <e-toolbaritem name=\"Cut\"></e-toolbaritem>\n        <e-toolbaritem name=\"Copy\"></e-toolbaritem>\n        <e-toolbaritem name=\"Paste\"></e-toolbaritem>\n        <e-toolbaritem name=\"Delete\"></e-toolbaritem>\n        <e-toolbaritem name=\"Download\"></e-toolbaritem>\n        <e-toolbaritem name=\"Rename\"></e-toolbaritem>\n        <e-toolbaritem name=\"Selection\"></e-toolbaritem>\n        <e-toolbaritem name=\"View\"></e-toolbaritem>\n        <e-toolbaritem name=\"Details\"></e-toolbaritem>\n      </e-toolbaritems>        \n    </ejs-filemanager>\n</div>\n"
    },
    {
      "target": "src/components/file-manager-directory-upload/file-manager.component.ts",
      "content": "import { Component, ViewEncapsulation, ViewChild } from '@angular/core';\nimport { FileManagerComponent, NavigationPaneService, ToolbarService, DetailsViewService, FileManagerModule } from '@syncfusion/ej2-angular-filemanager';\nimport { ItemModel, DropDownButtonModule } from '@syncfusion/ej2-angular-splitbuttons';\n/**\n * File Manager directory upload feature sample\n */\n\n@Component({\n    selector: 'control-content',\n    templateUrl: 'file-manager.component.html',\n    styleUrls: ['../file-manager-common.style.css'],\n    encapsulation: ViewEncapsulation.None,\n    providers: [NavigationPaneService, ToolbarService, DetailsViewService],\n    standalone: true,\n    imports: [FileManagerModule, DropDownButtonModule]\n})\n\nexport class DirectoryUploadController {\n    @ViewChild('fileObj')\n    public fileObj!: FileManagerComponent;\n    public ajaxSettings!: object;\n    public contextMenuSettings!: object;\n    public uploadLabel: string = 'Upload';\n    public hostUrl: string = 'https://physical-service.syncfusion.com/';\n    public ngOnInit(): void {\n        this.ajaxSettings = {\n            url: this.hostUrl + 'api/FileManager/FileOperations',\n            getImageUrl: this.hostUrl + 'api/FileManager/GetImage',\n            uploadUrl: this.hostUrl + 'api/FileManager/Upload',\n            downloadUrl: this.hostUrl + 'api/FileManager/Download'\n        };\n        this.contextMenuSettings = {\n            file: [ 'Cut', 'Copy', '|', 'Delete', 'Download', 'Rename', '|', 'Details'],\n            visible: true\n        };\n    }\n    //DropDownButton items definition\n    public items: ItemModel[] = [];\n    public onSuccess() {\n        this.uploadLabel = this.fileObj.localeObj.getConstant('Upload');\n        this.items = [\n            { text: this.fileObj.localeObj.getConstant('Folder') },\n            { text: this.fileObj.localeObj.getConstant('File') },\n        ];\n        if (document.getElementById(\"dropButton\")!.classList.contains(\"e-dropdown-btn\")) {\n            let customBtn: HTMLElement = document.getElementById('dropButton')!;\n            customBtn.onclick = (e) => {\n                e.stopPropagation();\n            };\n        }\n    }\n\n    public onSelect(args: any): void {\n        if (args.item.text === this.fileObj.localeObj.getConstant('Folder')) {\n            this.fileObj.uploadSettings.directoryUpload = true;\n        } else {\n            this.fileObj.uploadSettings.directoryUpload = false;\n        }\n        setTimeout(function () {\n            let uploadBtn: HTMLElement = document.querySelector('.e-file-select-wrap button') as HTMLElement;\n            uploadBtn.click();\n        }, 100);\n    }\n}\n"
    }
  ]
}