3

I have implemented the drag and drop using dropzone.js and I used "Browse" link.

The Browse link is using the HTML file upload and my code is:

<a href="javascript:void(0);">Browse</a>
<input id="upload" type="file" style="display:none;" />

On clicking the browse, it opens the "Open" file dialog box.

Now What I want to do is, I want to disable the "Drag & Drop" feature for that dialog. That is, If I select and drag the files, files getting dragged in that dialog and displays like "+Copy or +Move(Without releasing the mouse button)". I want to disable this feature in that Open file dialog. I want to upload by clicking Open button only and not by dragging in that dialog box.

How to disable the drag feature for that dialog?

1
  • if you provide a jsfiddle replicating your problem you will get more responses Commented Sep 9, 2015 at 5:53

1 Answer 1

-1

If you don't want to drag-drop file in input file up-loader, you can use

  $('#upload').on('drop', function (e) {
     return false;
});
Sign up to request clarification or add additional context in comments.

2 Comments

i jus disabled the drag and drop feature for this ID "upload" It worked for me in both IE 11 and chrome. thanks naveen
I gave it like the following: <input id="upload" type="file" style="display:none;" ondrop="return false;" />@Naveen Ravichandran

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.