{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-pass-custom-value-to-server",
  "framework": "react",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "pass-custom-value-to-server",
  "dependencies": [
    "@syncfusion/ej2-react-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/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/file-manager-pass-custom-value-to-server.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-pass-custom-value-to-server/FileManager.tsx",
      "content": "import { FileManagerComponent, Inject, NavigationPane, DetailsView, Toolbar } from '@syncfusion/ej2-react-filemanager';\n\n/**\n * File Manager sample that passes a custom value to the server\n */\nconst PassCustomValueToServer = () => {\n    let hostUrl: string = \"https://physical-service.syncfusion.com/\";\n\n    function onBeforeSend(args: any) {\n        if (args.ajaxSettings) {\n            args.ajaxSettings.beforeSend = function (args: any) {\n                args.httpRequest.setRequestHeader('Authorization', 'User1');\n            };\n        }\n    }\n\n    function 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\n    function 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    return (\n        <div>\n            <div className=\"control-section\">\n                <FileManagerComponent id=\"file\"\n                    ajaxSettings = {{\n                        url: hostUrl + \"api/FileManager/FileOperations\",\n                        downloadUrl: hostUrl + \"api/FileManager/Download\",\n                        uploadUrl: hostUrl + \"api/FileManager/Upload\",\n                        getImageUrl: hostUrl + \"api/FileManager/GetImage\"\n                    }} beforeSend={onBeforeSend.bind(this)} beforeDownload={onBeforeDownload.bind(this)} beforeImageLoad={onBeforeImageLoad.bind(this)}>\n                    <Inject services={[NavigationPane, DetailsView, Toolbar]} />\n                </FileManagerComponent>\n            </div>\n        </div>\n    );\n}\nexport default PassCustomValueToServer;\n"
    }
  ]
}