Drag and Drop Component to upload a File with Progress Bar - Pure HTML and Javascript. There may be many ways to upload attachments in Salesforce, but using visualfroce we can create pages which have both the drag and drop component and the progress bar together. In the example which I am giving I am using simple Apex REST API to attach the files to the respected ID. Drag and Drop Apex Class @RestResource(urlMapping='/DragAndDrop/v1/*') global with sharing class DragAndDropRESTAPI { @HttpPost global static String attachDoc(){ RestRequest req = RestContext.request; RestResponse res = Restcontext.response; String fName = req.params.get('FileName'); String parId = req.params.get('parId'); Blob postContent = req.requestBody; Attachment a = new Attachment (ParentId = parId, Body = postContent, Name = fName); ...