2

I am developing a community

One of the pages use lightning:fileUpload component

When I try to upload a file using the Customer Community user I allways get an error: Can't upload 'file name':

enter image description here

Question

Can I use the lightning:fileUpload component with a Customer Community user?

Or maybe there is a problem with the File object or Content?

5
  • Are you able to capture any error logs? – Jayant Das Apr 18 '18 at 13:13
  • I cannot see any console logs in the chrome dev console and no logs at all for the user as apex debug log – Itai Shmida Apr 18 '18 at 13:19
  • And I assume that the profile has access to ContentDocument object (and related ones)? – Jayant Das Apr 18 '18 at 13:21
  • I checked - cannot find the object to give access to, which object exactly do you mean? – Itai Shmida Apr 18 '18 at 13:27
  • Which record are you uploading on? I was able to replicate the issue. So if I used an say Account, I was able to upload the file (that meaning you can use the component on community). However when I tried it on an Opportunity, (which is not available with Customer Community) got exactly the same error. So you may like to verify to which record the file is getting uploaded to. – Jayant Das Apr 18 '18 at 14:23
4

As for your original question:

Can I use the lightning:fileUpload component with a Customer Community user?

The answer is - Yes, you can use lightning:fileUpload component in Communities.

As for the error you are getting, you may like to verify if you are uploading the file to the correct record or not and that if you have the right access on the object/record provided for the community user to be able to upload the file. E.g., if you are uploading a file to Opportunity in a Customer Community, you will get error exactly as you have reported.

Below screenshots are from my test community, where I was able to upload a file successfully to Contact, whereas I got exactly the same error as you reported, if I uploaded it on an Opportunity.

Successful upload enter image description here

Failed to upload (when tried to upload on object not supported in the community) enter image description here

2
  • Thanks @JayantDas - that is exactly my problem. this works good on other objects, but not on my opportunity - because of the customer community license. Do you have any workaround for this problem? – Itai Shmida Apr 22 '18 at 7:43
  • If you need access to opportunities, you need to have Partner community licenses. Opportunity is not supported in customer communities. You can get more details here. – Jayant Das Apr 22 '18 at 14:44
0

But if you still facing the same issue. Have on this useful document provided by Salesforce. - https://help.salesforce.com/articleView?id=Can-t-upload-or-Can-t-add-1-file-to-when-uploading-a-File&language=en_US&type=1

3
  • this has nothing to do with the problem that I had - please read the question carefully – Itai Shmida Oct 31 '18 at 13:46
  • 1. Can I use the lightning:fileUpload component with a Customer Community user? Yes, you can use lightning:fileUpload component in Communities. 2. Or maybe there is a problem with the File object or Content? It may happen that there will be active validation rules under 'Salesforce Files' that is restricting you from uploading the files. So above will tell about this in detail. – Sandesh Ganjare Nov 14 '18 at 12:50
  • you can use lightning:fileUpload with customer community, as long as you have access to the parent object of the file – Itai Shmida Nov 14 '18 at 12:52

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.