You can use this feature for users to upload files to your server.
In this post, you’ll learn:
- How you can provide HTML5 Drag and Drop
- How to send files using jQuery Ajax.
- Learn how to attach additional data onto the data sent to the sever
- Create a generic handler in ASP.NET to receive the files.
Of course other servers can be used, such as ASP.NET MVC, ASP.NET Web API, PHP, and Node.js. I’ll provide references to sample code for other servers in the References section.
In the last post, we showed you the basics of drag and drop. Drag-and-drop functionality is something that computer users have come to take for granted as “just working,” and there are a few ways to enable it within the browser.
You learned how you need to have a drag source and a drop target, and how to specify each in HTML5. And we learned how the dataTransfer object is used to send data between the drag source and the drop target.
In this chapter, we learn more about how to use Drag and Drop with files.
Drag and drop is a part of the HTML5 standard. Drag-and-drop functionality is something that computer users have come to take for granted as “just working,” and there are a few ways to enable it within the browser.
Imagine a computer or smartphone with a pointing device. — a drag operation could be like a mousedown event that is followed by a series of mousemover events, and the drop could be triggered by the mouse being released.