function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bakul.patelbakul.patel 

Uploading a file using lightning component

I am trying to upload a file using lightning component. I do have good understanding of the code involved, but for some reason the I try to get "files" from the input element type=file, it returns undefined.
 
var fileInput = document.getElementById("file1");
var file = fileInput.files;
I get undefined in 2nd line.

Anybody has file uploading working through lightning?