# file-manager-pass-custom-value-to-server

> File manager that sends a custom value to the server with file, download and image requests.

**Framework:** vue  **Component:** FileManager  **Variant:** pass-custom-value-to-server

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/vue/file-manager-pass-custom-value-to-server.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-vue-filemanager
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/file-manager-pass-custom-value-to-server/FileManager.vue

```vue
<template>
  <div class="control-section file-custom-value">
    <div class="sample-container">
      <ejs-filemanager
        id="file-manager"
        :ajaxSettings="ajaxSettings"
        :beforeSend="onBeforeSend"
        :beforeDownload="onBeforeDownload"
        :beforeImageLoad="onBeforeImageLoad"
      />
    </div>
  </div>
</template>

<script lang="ts">
import { FileManagerComponent, DetailsView, NavigationPane, Toolbar } from '@syncfusion/ej2-vue-filemanager';

const hostUrl = 'https://physical-service.syncfusion.com/';

export default {
  components: {
    'ejs-filemanager': FileManagerComponent
  },
  data() {
    return {
      ajaxSettings: {
        url: hostUrl + 'api/FileManager/FileOperations',
        getImageUrl: hostUrl + 'api/FileManager/GetImage',
        uploadUrl: hostUrl + 'api/FileManager/Upload',
        downloadUrl: hostUrl + 'api/FileManager/Download'
      }
    };
  },
  provide() {
    return {
      filemanager: [DetailsView, NavigationPane, Toolbar]
    };
  },
  methods: {
    onBeforeSend(args: any) {
      if (args.ajaxSettings) {
        args.ajaxSettings.beforeSend = function (args: any) {
          args.httpRequest.setRequestHeader('Authorization', 'User1');
        };
      }
    },
    onBeforeDownload(args: any) {
      args.useFormPost = false;
      if (args.ajaxSettings) {
        args.ajaxSettings.beforeSend = function (args: any) {
          args.fetchRequest.headers.append('Authorization', 'User1');
        };
      }
    },
    onBeforeImageLoad(args: any) {
      args.useImageAsUrl = false;
      // Check if ajaxSettings are present in the arguments
      if (args.ajaxSettings) {
        args.ajaxSettings.beforeSend = function (args: any) {
          // Append Authorization header with value 'User1' to fetchRequest headers
          args.fetchRequest.headers.append('Authorization', 'User1');
        };
      }
    }
  }
};
</script>

<style scoped>
.file-custom-value .sample-container {
  margin: 10px 10px 10px 10px;
}
</style>

```
