Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When dragging and dropping files to Internet Explorer and Chrome, they both open the file that was dragged and dropped. I would like to disable this functionality so that the dragged and dropped file does not automatically open.

Is this a browser setting or a Windows setting?

share|improve this question
    
What do you want it to do instead? –  ϺОŞΣŞ Sep 23 '13 at 23:27
    
We have a web app that has a drop area and we want the files to upload without opening. –  David Sep 23 '13 at 23:48
    
what's really strange is that dragging and dropping the file to Chrome doesn't open the file for 99% of our users (there's only a few that Chrome opens the file for). With that said, IE 9 and 10 open the file 100% of the time. –  David Sep 23 '13 at 23:50
    
This would be an issue with your drag and drop javascript or HTML, rather than an issue with a browser. The file is being opened because the drag and drop code is not triggering. It will still not trigger if you disable file-open in the browser. Best to try to debug the code. –  Paul Sep 24 '13 at 1:18
    
That's what I was thinking as well Paul but for it to not open for 99% of our chrome users made me think that the issue was elsewhere. And why would it work one way in chrome and another way in IE? –  David Sep 24 '13 at 1:33

1 Answer 1

I think this is what you are looking for...

 $( '#div_yourdroparea' ).bind( 'dragover',function(event) {
        event.stopPropagation();    
        event.preventDefault(); 
    });
    $( '#div_yourdroparea' ).bind( 'drop',function(event) {
     event.stopPropagation();   
      event.preventDefault();

    //your upload code goes here....
        }
share|improve this answer
    
How should this could help at solving the OP's problem? –  Jens Erat Aug 7 at 6:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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