# file-manager-restrict-drag-and-drop-upload

> File manager that blocks uploads dragged in from the desktop by clearing the uploader drop area.

**Framework:** angular  **Component:** FileManager  **Variant:** restrict-drag-and-drop-upload

## 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/angular/file-manager-restrict-drag-and-drop-upload.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-angular-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-restrict-drag-and-drop-upload/file-manager.component.html

```html
<div class="sample-container">
    <ejs-filemanager #fileManagerInstance id='file-manager' [ajaxSettings]='ajaxSettings' (created)="onCreated()" height="375px">
    </ejs-filemanager>
</div>

```

### src/components/file-manager-restrict-drag-and-drop-upload/file-manager.component.ts

```typescript
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
import { FileManagerComponent, FileManagerModule, NavigationPaneService, ToolbarService, DetailsViewService } from '@syncfusion/ej2-angular-filemanager';
/**
 * File Manager restrict external drag and drop upload sample
 */
@Component({
    selector: 'control-content',
    templateUrl: 'file-manager.component.html',
    styleUrls: ['../file-manager-common.style.css'],
    encapsulation: ViewEncapsulation.None,
    providers: [NavigationPaneService, ToolbarService, DetailsViewService],
    standalone: true,
    imports: [FileManagerModule]
})

export class RestrictDragAndDropUploadController {
    @ViewChild('fileManagerInstance')
    public fileManagerInstance?: FileManagerComponent;
    public ajaxSettings?: object;
    public hostUrl: string = 'https://physical-service.syncfusion.com/';
    public ngOnInit(): void {
        this.ajaxSettings = {
            url: this.hostUrl + 'api/FileManager/FileOperations',
            getImageUrl: this.hostUrl + 'api/FileManager/GetImage',
            uploadUrl: this.hostUrl + 'api/FileManager/Upload',
            downloadUrl: this.hostUrl + 'api/FileManager/Download'
        };
    }
    onCreated() {
        if (this.fileManagerInstance) {
            this.fileManagerInstance.uploadObj.dropArea = '';  // Restrict file uploads by dragging them from the local file system to the File Manager.
        }
    }
}

```
