I have a requirement to allow a user to upload a csv and the system needs to process the file. I am planning to write an apex batch that is scheduled when a file is uploaded. The batch will need to know which file exactly to process. Is there a way to find the content document id of the file that was uploaded using lighting-file-upload ?

1 Answer 1


I realized I can get it like this

   <lightning-file-upload  record-id={accountId} onuploadfinished = {handleAddressUploadFinised}> </lightning-file-upload>

handleAddressUploadFinised(event) {
            const uploadedFile = event.detail.files[0];
            var documentId  = uploadedFile.documentId;  // this gives the Id for the contentDocument

  • you should mark this as 'answered'
    – cropredy
    Jul 12, 2019 at 2:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .