Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileUploadImproved - access to contentVersionId and an onuploadfinished handler #1591

Open
dschueler opened this issue Sep 28, 2024 · 0 comments

Comments

@dschueler
Copy link

dschueler commented Sep 28, 2024

I am using embed FileUploadImproved in my custom component. My component currently uses

 <lightning-file-upload
        label="Upload Image"
        name="fileUploader"
        accept={acceptedFormats}
        record-id={recordId}
        onuploadfinished={handleUploadFinished}
        multiple="false"
    ></lightning-file-upload>

Once file is uploaded, I use the ContentVersionId in the UploadFinished handler.
handleUploadFinished(event) {
const uploadedFiles = event.detail.files;
if (uploadedFiles.length > 0) {
const contentVersionId = uploadedFiles[0].contentVersionId;

I modified FileUploadImproved to fire an event to my parent component upon upload etc. to get ContentVersionId. etc. but I would rather not have to modify your code.

The uploaded file is visible in SF or as logged in user but still not publicly and not logged in for some reason I am yet to figure out. Any thoughts?

Thanks in advance

@dschueler dschueler changed the title FileUploadImproved - access to FileUploadImproved - access to contentVersionId and an onuploadfinished handler Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant