1

I am having difficulties using lightning-file-upload in LWR using the guest user.

I have already enabled the options in Salesforce files > Settings

I have already enabled it in the community for users to see the "Allow users to view asset files, library files, and CMS content available to the site (To allow guest users to view CMS collections, also enable Allow guest users to access public APIs)"

But nothing works, the error that comes back to me is this

Thank you in advance for your attention.

LWC.html <lightning-file-upload label="Anexe o arquivo aqui..." name="fileUploader" accept={acceptedFormats} onuploadfinished={handleUploadFinished}> </lightning-file-upload> LWC.js handleUploadFinished(event) { // Get the list of uploaded files const uploadedFiles = event.detail.files; this.idDoc = uploadedFiles[0].documentId; this.caminho += uploadedFiles[0].name; console.log('CAMINHO => ' + this.caminho); console.log('ID => ' + this.idDoc); } 

Salesforce Files Settings

Administation Community

Error Upload XML Error

3
  • Try to go to Salesforce Files -> Settings -> General Settings and check the checkbox for "Allow site guest users to upload files". It should work. Commented Nov 25, 2024 at 10:08
  • Also, check this: ideas.salesforce.com/s/idea/a0B8W00000NW57cUAD/… Commented Nov 25, 2024 at 10:09
  • I tried this configuration, it's even in the prints, they are in Portuguese but it is enabled there I think I'll need to find an alternative solution, this functionality doesn't seem to be perfect yet Commented Nov 25, 2024 at 12:42

1 Answer 1

0

I managed to find what was missing, it was the option All sites > Workspace > Administration > Preferences > enable "Allow guest users to access public APIs"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.