HTML5 drag and drop - how to limit only local files

I am working on a project for dragging and dropping HTML5 images and am facing a problem:

If the user drags an image that is already on the page, the onDragEnter / onDragOver events are still triggered.

Is there a way to trigger an event only if the file comes from the local computer (drag and drop from the desktop, folders, etc.), and not from the page itself?

Thank you for your help.

+3
source share
1 answer

Can you set the attribute draggablefor all the images on the page false?

0
source

All Articles