Drag and Drop automatic file upload in Liferay CMS and ForgeCart, a complete eCommerce solution
General Blogs November 17, 2012 By Jonas Yuan
There are a lot of demos and tutorials that show you how to drag-and-drop a file into the browser and then render it on the page. This article is going to address how to bring the feature (Drag and Drop automatic file upload) into Liferay CMS and ForgeCart, a complete eCommerce solution.
- Capture the drop event and read its data.
- Post that binary data to the server.
- Provide feedback on the progress of the upload.
- Optionally render a preview of what's being uploaded and its status.
- FormData object represents an ordered collection of entries. Each entry has a name and value.
- FileReader interface provides methods to read File objects or Blob objects into memory, and to access the data from those Files or Blobs using progress events and event handler attributes; it inherits from EventTarget. It is desirable to read data from file systems asynchronously in the main thread of user agents.
Drag and drop, automatic file upload into Server Document and Media, integrated with Tree-View.
Online demo (Liferay Portal 6.1 GA2)
drag and drop , automatic file upload