{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-pass-custom-value-to-server",
  "framework": "vue",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "pass-custom-value-to-server",
  "dependencies": [
    "@syncfusion/ej2-vue-filemanager"
  ],
  "description": "File manager that sends a custom value to the server with file, download and image requests.",
  "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-pass-custom-value-to-server.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-pass-custom-value-to-server/FileManager.vue",
      "content": "<template>\n  <div class=\"control-section file-custom-value\">\n    <div class=\"sample-container\">\n      <ejs-filemanager\n        id=\"file-manager\"\n        :ajaxSettings=\"ajaxSettings\"\n        :beforeSend=\"onBeforeSend\"\n        :beforeDownload=\"onBeforeDownload\"\n        :beforeImageLoad=\"onBeforeImageLoad\"\n      />\n    </div>\n  </div>\n</template>\n\n<script lang=\"ts\">\nimport { FileManagerComponent, DetailsView, NavigationPane, Toolbar } from '@syncfusion/ej2-vue-filemanager';\n\nconst hostUrl = 'https://physical-service.syncfusion.com/';\n\nexport default {\n  components: {\n    'ejs-filemanager': FileManagerComponent\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    };\n  },\n  provide() {\n    return {\n      filemanager: [DetailsView, NavigationPane, Toolbar]\n    };\n  },\n  methods: {\n    onBeforeSend(args: any) {\n      if (args.ajaxSettings) {\n        args.ajaxSettings.beforeSend = function (args: any) {\n          args.httpRequest.setRequestHeader('Authorization', 'User1');\n        };\n      }\n    },\n    onBeforeDownload(args: any) {\n      args.useFormPost = false;\n      if (args.ajaxSettings) {\n        args.ajaxSettings.beforeSend = function (args: any) {\n          args.fetchRequest.headers.append('Authorization', 'User1');\n        };\n      }\n    },\n    onBeforeImageLoad(args: any) {\n      args.useImageAsUrl = false;\n      // Check if ajaxSettings are present in the arguments\n      if (args.ajaxSettings) {\n        args.ajaxSettings.beforeSend = function (args: any) {\n          // Append Authorization header with value 'User1' to fetchRequest headers\n          args.fetchRequest.headers.append('Authorization', 'User1');\n        };\n      }\n    }\n  }\n};\n</script>\n\n<style scoped>\n.file-custom-value .sample-container {\n  margin: 10px 10px 10px 10px;\n}\n</style>\n"
    }
  ]
}