1

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 ?

0

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 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.