0

I am creating a profile page for the user to upload their photos.

To carry out the image upload, I use the component lightning:fileUpload, since when uploading a file it returns the id saved in files. I save that id in the user and show the image with a lightning:fileCard.

All good because when I restart the page, it shows the image uploaded by the user.

enter image description here

But my question is: why can't I see the uploaded images in files? enter image description here

0

Which Id value are you using for the recordId attribute of the lightning:fileUpload component? If it is the User Id, that File is stored in the user's private library and won't show up in the Files tab for other users.

To share the uploaded file with other users, you have a couple options:

Set the recordId attribute to another record that is viewable by other users. This can be another custom object, but in this case I might recommend a shared content library.

In the code that uses the lightning:fileUpload component, use the returned Ids of the files to create ContentDocumentLink records that share the file with something the other users have access to, such as the shared Content Library.

3
  • That makes more sense, since, as an admin user, I can see what I upload. Now the question is, if there is any configuration to display what users upload? Mar 16 at 15:51
  • @FelipePeña added details for sharing the file with additional users
    – Jeff Kranz
    Mar 16 at 19:31
  • To obtain the LinkedEntityId method I must obtain the id of the folder that is in Library but the user I use does not give me access to the folder and that adds the users Mar 23 at 21:33

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.