Drag and Drop Support

The file explorer allows the files to move from one folder to another by using drag and drop. It also supports uploading a file by dragging it from Windows Explorer to a folder in the file explorer control.

You can enable or disable this support by using the “AllowDragAndDrop” API of FileExplorer.

The dragStart, drag, dragStop and drop events occur in the mentioned order when a drag and drop operation is performed.

In the view page, add “FileExplorer” helper and specify the drag and drop option as specified in the following:

  • cshtml
  • <ej-file-explorer id="file" path="wwwroot/images/FileExplorer" ajax-action="@Url.Content("FileActionDefault")" allow-drag-and-drop="false">
        <e-file-ajax-settings>
            <e-download url="/FileExplorer/Download{0}"></e-download>
            <e-get-image url="/FileExplorer/GetImage{0}"></e-get-image>
            <e-upload url="/FileExplorer/Upload{0}"></e-upload>
        </e-file-ajax-settings>
    </ej-file-explorer>