Wednesday, November 22, 2017

Uploading multiple files with the Salesforce Lightning file upload Component (Winter 18)

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: 
lightning:fileUpload component layout





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. 

3 comments:

  1. Hi Kevan,

    Nice 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

    ReplyDelete
  2. Hi Kevan,

    I 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 ?

    ReplyDelete
    Replies
    1. Hi,
      It 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.

      Delete