Skip to main content

Hi all,

 i am inserting single record with single attachment using lightning aura component.but how to insert single record with multiple files in single transaction.how i am achive this please let me know.

 

Please refer this link how i am make changes for multiple files.

http://sfdcmonkey.com/2017/09/25/file-upload-lightning-component/

1 commento
  1. 2 set 2021, 08:07

    Hi @venkatesh j,

     

    you can set the "multiple" attribute to true in lightning:input type="file".

    Hope this is helpful :

    <lightning:input name="file1" type="file" label="Attachment"

    multiple="true" onchange="{!c.handleMultipleFiles}"/>

     

    handleMultipleFiles: function (component, event) {

    let files = event.getSource().get("v.files");

    console.log("all files : ", files);//contains the array of selected files

    alert(files.length + ' files !!'); //displays no. of files selected

    }

0/9000