# file-manager-restrict-drag-and-drop-upload

> File manager that blocks uploads dragged in from the desktop by clearing the uploader drop area.

**Framework:** react  **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/react/ts/file-manager-restrict-drag-and-drop-upload.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-react-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/FileManager.tsx

```tsx
import { DetailsView, FileManagerComponent, NavigationPane, Toolbar, Inject, type ViewType } from '@syncfusion/ej2-react-filemanager';

/**
 * File Manager restrict external drag and drop upload sample
 */
const RestrictDragAndDropUpload = () => {
  let hostUrl: string = "https://physical-service.syncfusion.com/";
  let fileObj: FileManagerComponent;
  let ajaxSettings: object = {
    downloadUrl: hostUrl + 'api/FileManager/Download',
    getImageUrl: hostUrl + "api/FileManager/GetImage",
    uploadUrl: hostUrl + 'api/FileManager/Upload',
    url: hostUrl + "api/FileManager/FileOperations"
  };
  let height: string = "375px";
  let view: ViewType = "LargeIcons";

  function onCreated() {
    fileObj.uploadObj.dropArea = '';  // Restrict file uploads by dragging them from the local file system to the File Manager.
  }
  return (
    <div className="control-section">
      <FileManagerComponent ref={ (s: FileManagerComponent | null) => { fileObj = s as FileManagerComponent; }} id="file" view={view} height={height}
        ajaxSettings={ajaxSettings}
        created={onCreated.bind(this)}>
        <Inject services={[NavigationPane, DetailsView, Toolbar]} />
      </FileManagerComponent>
    </div>
  );
}
export default RestrictDragAndDropUpload;

```
