Skip to main content
added 9 characters in body
Source Link
GoldenAxe
  • 477
  • 2
  • 6
  • 17

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself (on v40) and it is working.

..helper.js:

handleFilesChange : function(component, event)
{
    var uploadFile = event.getSource().get("v.files")[0];
}

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself and it is working.

..helper.js:

handleFilesChange : function(component, event)
{
    var uploadFile = event.getSource().get("v.files")[0];
}

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself (on v40) and it is working.

..helper.js:

handleFilesChange : function(component, event)
{
    var uploadFile = event.getSource().get("v.files")[0];
}
added 16 characters in body
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself and it is working.

..helper.js:

handleFilesChange : function(component, event) { var uploadFile = event.getSource().get("v.files")[0]; }

handleFilesChange : function(component, event)
{
    var uploadFile = event.getSource().get("v.files")[0];
}

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself and it is working.

..helper.js:

handleFilesChange : function(component, event) { var uploadFile = event.getSource().get("v.files")[0]; }

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself and it is working.

..helper.js:

handleFilesChange : function(component, event)
{
    var uploadFile = event.getSource().get("v.files")[0];
}
Source Link
GoldenAxe
  • 477
  • 2
  • 6
  • 17

If you are using onchange="{! c.handleFilesChange }" on the lightning:input component, you can get the list of files by using the following command: event.getSource().get("v.files"), according to the docs.

I have tried it myself and it is working.

..helper.js:

handleFilesChange : function(component, event) { var uploadFile = event.getSource().get("v.files")[0]; }