3

In SharePoint we have default functionality that we can drag and drop documents in document library.

I want to disable drag and drop functionality. How can I do that?

I do not want to change in drag and drop's js that is reside in layout folder. Because it will effect on entire farm.

I want to change for specific site collection and only for document library.

1
1

add this code in content editor web part:

<script>
    ExecuteOrDelayUntilScriptLoaded(function() {

             g_uploadType = DragDropMode.NOTSUPPORTED;
             SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED;
        }, "DragDrop.js");

</script>
0

For disable Drag and Drop functionality add below code in "Script Editor".

Go to Setting -> Edit Page -> Insert -> Web Part -> Media and Content -> Script Editor and refresh the library.

<script>
    ExecuteOrDelayUntilScriptLoaded(function() {
             g_uploadType = DragDropMode.NOTSUPPORTED;
             SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED;
        }, "DragDrop.js");
</script>

That definitely works, I have tried.

1
  • I've seen this several places, but does not work on my SharePoint 2013.
    – mannaggia
    Jun 22 '17 at 13:20
0

I've also done the below to disable drag and drop:

  1. add content editor web part to page
  2. while Content Editor web part is selected, under "format text" in ribbon click edit source
  3. add html ​​<style> #ms-dnd-dropbox{ display: none !important; } </style>​​

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.