Quantcast
Channel: Active questions tagged lightning-experience - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 3022

Append files to the first upload in

$
0
0

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");

}

  1. 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?

  2. 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


Viewing all articles
Browse latest Browse all 3022

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>