# file-manager-api

> File manager without navigation pane, with toggles for toolbar, file extensions and thumbnails.

**Framework:** javascript  **Component:** FileManager  **Variant:** api

## 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/javascript/file-manager-api.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-filemanager @syncfusion/ej2-buttons @syncfusion/ej2-dropdowns
```

**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-api/file-manager.html

```html
<div class="col-lg-8  control-section">
    <div class="sample-container">
        <!-- Initialize FileManager -->
        <div id="container"></div>
    </div>
</div>
<div class="col-lg-4 property-section" id="all-option-table">
        <table id="property" title="Properties">
            <tbody>
                <tr id="rangeSelectionRow">
                    <td style="width: 50%">
                        <div id="checkboxElement">Enable Range Selection</div>
                    </td>
                    <td style="width: 50%;padding-right: 10px;text-align: center;">
                        <div>
                            <input id="rangeSelection" type="checkbox" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50%">
                        <div id="checkboxElement">Toolbar</div>
                    </td>
                    <td style="width: 50%;padding-right: 10px;text-align: center;">
                        <div>
                            <input id="toolbar" type="checkbox" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50%">
                        <div id="checkboxElement">Show File Extension</div>
                    </td>
                    <td style="width: 50%;padding-right: 10px;text-align: center;">
                        <div>
                            <input id="fileExtension" type="checkbox" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50%">
                        <div id="checkboxElement">Show Thumbnail</div>
                    </td>
                    <td style="width: 50%;padding-right: 10px;text-align: center;">
                        <div>
                            <input id="thumbnail" type="checkbox" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50%">
                        <div id="checkboxElement">Disable Toolbar Item</div>
                    </td>
                    <td style="width: 50%;padding-left: 10px;text-align: center;">
                        <div>
                            <input id="disable" type="text" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50%">
                        <div id="checkboxElement">Enable Toolbar Item</div>
                    </td>
                    <td style="width: 50%;padding-left: 10px;text-align: center;">
                        <div>
                            <input id="enable" type="text" />
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
</div>

<style>
    .property-panel-table div {
        padding-left: 0;
        padding-top: 0;
    }

    #all-option-table .property-panel-section .property-panel-content table#property tr {
        height: 50px;
    }
    #checkboxElement {
        font-size:14px;
    }

     @media (max-width: 550px) {
        #rangeSelectionRow {
            display: none ;
        }
    }

</style>

```

### src/components/file-manager-api/file-manager.ts

```typescript
import { FileManager, Toolbar, NavigationPane, DetailsView, ContextMenu } from '@syncfusion/ej2-filemanager';
import { CheckBox } from '@syncfusion/ej2-buttons';
import { DropDownList } from '@syncfusion/ej2-dropdowns';

FileManager.Inject(Toolbar, NavigationPane, DetailsView, ContextMenu);

/**
 * File Manager API sample
 */
export function initFileManagerApi(): void {
    let hostUrl: string = 'https://physical-service.syncfusion.com/';
    let fileObject: FileManager = new FileManager({
        ajaxSettings: {
            url: hostUrl + 'api/FileManager/FileOperations',
            getImageUrl: hostUrl + 'api/FileManager/GetImage',
            uploadUrl: hostUrl + 'api/FileManager/Upload',
            downloadUrl: hostUrl + 'api/FileManager/Download'
        },
        toolbarSettings: { items: ['NewFolder', 'SortBy', 'Cut', 'Copy', 'Paste', 'Delete', 'Refresh', 'Download', 'Rename', 'Selection', 'View', 'Details'] },
        contextMenuSettings: {
            file: [ "Cut", "Copy", "|", "Delete", "Download", "Rename", "|", "Details"],
            layout: ["SortBy", "View", "Refresh", "|", "Paste", "|", "NewFolder", "|", "Details", "|", "SelectAll"],
            visible: true
        },
        navigationPaneSettings: { visible: false },
        view: 'LargeIcons',
        enableRangeSelection: true
    });
    fileObject.appendTo('#container');

    let rangeSelectionObj  : CheckBox = new CheckBox({ checked: true, change: onToolbarChange });
    rangeSelectionObj .appendTo('#rangeSelection');
    let checkBoxObj : CheckBox = new CheckBox({ checked: true, change: onToolbarChange });
    checkBoxObj.appendTo('#toolbar');
    let fileExtendObj : CheckBox = new CheckBox({ checked: true, change: onToolbarChange });
    fileExtendObj.appendTo('#fileExtension');
    let thumbnailObj : CheckBox= new CheckBox({ checked: true, change: onToolbarChange });
    thumbnailObj.appendTo('#thumbnail');
    let enableItems = ['NewFolder', 'Cut', 'Copy', 'Paste', 'Download', 'Delete', 'Refresh', 'Selection', 'View', 'Details'];
    let enableObj : DropDownList= new DropDownList({ dataSource: enableItems, placeholder: "Select item" ,change: onEnableItemChange });
    enableObj.appendTo('#enable');
    let disableItems = ['NewFolder', 'Cut', 'Copy', 'Paste', 'Download', 'Delete', 'Refresh', 'Selection', 'View', 'Details'];
    let disableObj : DropDownList = new DropDownList({ dataSource: disableItems, placeholder: "Select item", change: onDisableItemChange });
    disableObj.appendTo('#disable');

    function onToolbarChange(args: any): void {
        if (this.element.id == "toolbar") {
            fileObject.toolbarSettings.visible = args.checked;
        }
        if (this.element.id == "fileExtension") {
            fileObject.showFileExtension = args.checked;
        }
        if (this.element.id == "thumbnail") {
            fileObject.showThumbnail = args.checked;
        }
        if (this.element.id == "rangeSelection") {
            fileObject.enableRangeSelection = args.checked;
        }
    }

    function onDisableItemChange(args: any): void {
        if (args.itemData != null){
            fileObject.disableToolbarItems([args.itemData.value]);
            if(args.value === enableObj.value){
                enableObj.value = null;
            }
        }
    }

    function onEnableItemChange(args: any): void {
        if (args.itemData != null){
            fileObject.enableToolbarItems([args.itemData.value]);
            if(args.value === disableObj.value){
                disableObj.value = null;
            }
        }
    }
}

```
