{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-directory-upload",
  "framework": "vue",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "directory-upload",
  "dependencies": [
    "@syncfusion/ej2-vue-filemanager",
    "@syncfusion/ej2-vue-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/vue/llms.txt",
    "skillPack": "syncfusion/vue-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/vue/file-manager-directory-upload.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-directory-upload/FileManager.vue",
      "content": "<template>\n  <div class=\"control-section folder-upload\">\n    <div class=\"sample-container\">\n      <ejs-filemanager\n        id=\"filemanager\"\n        ref=\"filemanagerInstance\"\n        :ajaxSettings=\"ajaxSettings\"\n        :contextMenuSettings=\"contextMenuSettings\"\n        @success=\"onSuccess\"\n      >\n        <e-toolbaritems>\n          <e-toolbaritem name=\"NewFolder\"></e-toolbaritem>\n          <e-toolbaritem :template=\"'uploadTemplate'\" name=\"Upload\">\n            <template v-slot:uploadTemplate>\n              <div>\n                <ejs-dropdownbutton\n                  id=\"dropButton\"\n                  cssClass=\"e-tbar-btn e-tbtn-txt\"\n                  iconCss=\"e-icons e-fe-upload\"\n                  :items=\"getItems()\"\n                  :content=\"uploadContent\"\n                  :select=\"onSelect\"\n                  :onClick=\"uploadClick\"\n                />\n              </div>\n            </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  </div>\n</template>\n\n<script lang=\"ts\">\nimport { FileManagerComponent, NavigationPane, Toolbar, DetailsView, ToolbarItemDirective, ToolbarItemsDirective } from '@syncfusion/ej2-vue-filemanager';\nimport { DropDownButtonComponent } from '@syncfusion/ej2-vue-splitbuttons';\n\nconst hostUrl = 'https://physical-service.syncfusion.com/';\n\nexport default {\n  components: {\n    'ejs-filemanager': FileManagerComponent,\n    'ejs-dropdownbutton': DropDownButtonComponent,\n    'e-toolbaritem': ToolbarItemDirective,\n    'e-toolbaritems': ToolbarItemsDirective\n  },\n  data() {\n    return {\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      uploadContent: '<span class=\"e-tbar-btn-text\">Upload</span>'\n    };\n  },\n  provide() {\n    return {\n      filemanager: [NavigationPane, DetailsView, Toolbar]\n    };\n  },\n  methods: {\n    getItems() {\n      const fileObj = (this.$refs.filemanagerInstance as any)?.ej2Instances;\n      return [\n        { text: fileObj?.localeObj.getConstant('Folder') },\n        { text: fileObj?.localeObj.getConstant('File') }\n      ];\n    },\n    onSuccess() {\n      const fm = (this.$refs.filemanagerInstance as any).ej2Instances;\n      const label = fm.localeObj.getConstant('Upload');\n      this.uploadContent = `<span class=\"e-tbar-btn-text\">${label}</span>`;\n    },\n    onSelect(args: any) {\n      const fileObj = this.$refs.filemanagerInstance as any;\n      const fileObject = fileObj?.ej2Instances;\n      if (args.item.text === fileObject?.localeObj.getConstant('Folder')) {\n        fileObj.ej2Instances.uploadSettings.directoryUpload = true;\n      } else {\n        fileObj.ej2Instances.uploadSettings.directoryUpload = false;\n      }\n      setTimeout(function () {\n        const uploadBtn = document.querySelector('.e-file-select-wrap button') as HTMLElement;\n        uploadBtn.click();\n      }, 100);\n    },\n    uploadClick(args: MouseEvent) {\n      args.stopPropagation();\n    }\n  }\n};\n</script>\n\n<style scoped>\n.folder-upload .sample-container {\n  margin: 10px 10px 10px 10px;\n}\n</style>\n"
    }
  ]
}