# 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/js/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.jsx

```jsx
import { DetailsView, FileManagerComponent, NavigationPane, Toolbar, Inject } from '@syncfusion/ej2-react-filemanager';
/**
 * File Manager restrict external drag and drop upload sample
 */
const RestrictDragAndDropUpload = () => {
    let hostUrl = "https://physical-service.syncfusion.com/";
    let fileObj;
    let ajaxSettings = {
        downloadUrl: hostUrl + 'api/FileManager/Download',
        getImageUrl: hostUrl + "api/FileManager/GetImage",
        uploadUrl: hostUrl + 'api/FileManager/Upload',
        url: hostUrl + "api/FileManager/FileOperations"
    };
    let height = "375px";
    let view = "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) => { fileObj = s; }} id="file" view={view} height={height} ajaxSettings={ajaxSettings} created={onCreated.bind(this)}>
        <Inject services={[NavigationPane, DetailsView, Toolbar]}/>
      </FileManagerComponent>
    </div>);
};
export default RestrictDragAndDropUpload;

```
