This functionality is powered by the dragstart event. By attaching a specialized string to the dataTransfer object, you inform the browser that the item being dragged is a downloadable file. When the user releases the mouse button over their desktop, the browser initiates the download using that data. Implementation Guide
In your JavaScript, use the setData method to pass a specifically formatted string using the key "DownloadURL" . The format for this string is: MIME-type:filename:URL . javascript javascript drag and drop download
First, create an element in your HTML and ensure it has the draggable="true" attribute. Drag me to your desktop to download Use code with caution. 2. Handle the Drag Event This functionality is powered by the dragstart event