HTML5, [removed] Drag and Drop File from External Window (Windows Explorer)

前端 未结 3 1072
感情败类
感情败类 2020-12-07 16:57

Can I kindly ask for a good working example of HTML5 File Drag and Drop implementation? The source code should work if drag and drop is performed from exter

3条回答
  •  误落风尘
    2020-12-07 17:24

    Look into ondragover event. You could simply have a inside of a div that is hidden until the ondragover event fires a function that will show the div with the in it, thus letting the user drag and drop the file. Having an onchange declaration on the would let you automatically call a function (such as upload) when a file is added to the input. Make sure that the input allows for multiple files, as you have no control over how many they are going to try and drag into the browser.

提交回复
热议问题