I am using the following code in my lightning component to upload multiple files
<lightning:input aura:id="fileId" onchange="{!c.handleUploadFinished}" type="file" name="file" label="Upload Attachment" multiple="true"/>
JS Controller Code handleUploadFinished: function (component, event, helper) {
// Get the list of uploaded files
var fileInput = component.find("fileId").get("v.files");
}
So what I can see is that if I upload 2 files together, then upload another one, the previous two files get removed. My question is that is there any possible way to append the 3 files together instead of the first two getting removed?
My second question would be that can I assign the fileInput to an array attribute of the corresponding component? If so then what would be attribute type?
I am using the following blog as the base. http://sfdcmonkey.com/2017/09/25/file-upload-lightning-component