微软Edge html5文件拖放

时间:2022-11-19 19:47:46

We are adapting our product to MsEdge. We have a html5 drag and drop feature that works correctly in IE / Chrome, etc.

我们正在将我们的产品调整为MsEdge。我们有一个html5拖放功能,可以在IE / Chrome中正确运行。

Using Microsoft Edge from Win10 Insider Preview Build 10162, the drop is forbidden. We also checked http://html5demos.com/dnd-upload doesn't work neither.

使用微软Edge从Win10内部预览构建10162,删除是被禁止的。我们还检查了http://html5demos.com/dnd-upload也不起作用。

Anyone solved this?

有人解决了这个吗?

3 个解决方案

#1


6  

Edit: Microsoft implemented this feature by now.

编辑:微软现在已经实现了这个功能。

Original answer:

最初的回答:

The DragAndDropEntries is not supported in Microsoft Edge yet. See this link for more detail

在Microsoft Edge中还不支持DragAndDropEntries。有关更多细节,请参见此链接

It says:

它说:

Allows dragging and dropping entire folders using HTML5 Drag and Drop. Extends the DataTransferItem with a method to get a FileEntry/DirectoryEntry. Roadmap Priority: Low — We are still evaluating this technology. There may be significant spec stabilization, foundational work, or additional community input required before we can begin development."

允许拖放整个文件夹使用HTML5拖放。使用方法扩展DataTransferItem以获取FileEntry/DirectoryEntry。路线图优先:低-我们仍在评估这项技术。在我们开始开发之前,可能需要进行重要的规范稳定、基础工作或额外的社区投入。

However, feel free to request for this feature at https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer

但是,可以通过https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer请求这个特性

#2


1  

I just tried it the demo on Microsoft Edge and it worked fine for me. 微软Edge html5文件拖放

我刚在微软Edge上试用了一下,效果还不错。

#3


0  

Worked for me:

为我工作:

html:

html:

<input
    id = "dropzone"
    accept = "image/*"
    multiple = "false"
    type = "file"
/>

used javaScript 'drop' event :

使用javaScript“drop”事件:

const dropzone = document.getElementById('dropzone');

dropzone.addEventListener('drop', (event) => { /* your callback */ })

to get file used:

获得文件使用:

event.dataTransfer.files[0]

#1


6  

Edit: Microsoft implemented this feature by now.

编辑:微软现在已经实现了这个功能。

Original answer:

最初的回答:

The DragAndDropEntries is not supported in Microsoft Edge yet. See this link for more detail

在Microsoft Edge中还不支持DragAndDropEntries。有关更多细节,请参见此链接

It says:

它说:

Allows dragging and dropping entire folders using HTML5 Drag and Drop. Extends the DataTransferItem with a method to get a FileEntry/DirectoryEntry. Roadmap Priority: Low — We are still evaluating this technology. There may be significant spec stabilization, foundational work, or additional community input required before we can begin development."

允许拖放整个文件夹使用HTML5拖放。使用方法扩展DataTransferItem以获取FileEntry/DirectoryEntry。路线图优先:低-我们仍在评估这项技术。在我们开始开发之前,可能需要进行重要的规范稳定、基础工作或额外的社区投入。

However, feel free to request for this feature at https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer

但是,可以通过https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer请求这个特性

#2


1  

I just tried it the demo on Microsoft Edge and it worked fine for me. 微软Edge html5文件拖放

我刚在微软Edge上试用了一下,效果还不错。

#3


0  

Worked for me:

为我工作:

html:

html:

<input
    id = "dropzone"
    accept = "image/*"
    multiple = "false"
    type = "file"
/>

used javaScript 'drop' event :

使用javaScript“drop”事件:

const dropzone = document.getElementById('dropzone');

dropzone.addEventListener('drop', (event) => { /* your callback */ })

to get file used:

获得文件使用:

event.dataTransfer.files[0]