Salesforce has recently released the lightning:fileUpload component which is basically a file uploader for uploading and attaching files to records.
The provides an easy and integrated way for users to upload multiple files. The file uploader includes drag-and-drop functionality and filtering by file types.
For now, it is available only in beta. It will prevent us from writing complex code and as such, does not come with limitations such as heap sizes, problems with assigning permissions to custom devs.
Here are some preview of the component:
You can deploy the component to your Salesforce by clicking on the button below:
And source code is available at: https://github.com/kevanmoothien/lightning-file-uploader
Unfortunately, it only uploads files and for those who still want to use attachment, here is one of my previous blog on how it can be achieved.
Hi Kevan,
ReplyDeleteNice post, my requirement little different. I want to select/deselect , add file from other local location before clicking on upload. is this possible.
Thanks in advance
Pradeep
Hi Kevan,
ReplyDeleteI can add upto 10 files in a single go.
However i want to add upto 25 files in a single go. Can you help me with that ?
Hi,
DeleteIt is not possible with this standard lightning component. You will need to code it yourself.
However, you can use SharinPix Free AppExchange for that. They are specialised in images inside Salesforce.