0

Our team is trying to create a generic file uploader lightning component to use as a base component for a set of forms that need to be displayed in a community, but we keep finding issues or limitations:

  • Our first attempt was just building a normal file uploader with lightning. Although this one works fine, the limit of file size is ridiculous, less than one 1Mb, because of the message size that can be sent to the server side. Our use case needs more than that.

  • We also considered using Peter Knolle's approach chunking the message to the server and appending each chunk to the body of an Attachment. The limit goes up to around 4 - 4,5 Mb. But in our case, we need to use Files (ContentVersion) and they don't allow to update the content data once they are inserted.

  • At the end, we tried to use this approach embedding a VF page inside the component to allow up to 10Mb. And we thought it was working, actually, it works everywhere, except if you are logged in as an External user in a community, exactly our user case... Digging more we discovered that iframes are not supported in communities since winter 16 as they send an error message "Refused to display xxxxxxxxx in a frame because it set 'X-Frame-Options' to 'deny'". The odd thing is that if you are logged in as a system administrator, it still works.

Has anyone found a proper solution for having a file uploader component that can be used in other components in a lightning community? Or does anyone know if Salesforce is going to release a standard component soon?

0

See the Lightning roadmap - these components would be available on next release:

lightning:file

lightning:fileUpload

  • Yes, I'm aware of it. But we were trying to find a substitute in the meantime as the project is really urgent. – Guillem Medina Jul 24 '17 at 7:30
  • I use Peter Knolle's approach for Files and Attachments and I use them also in a community for external users, but they I limit the file size to be less than 1 MB. – Itai Shmida Jul 24 '17 at 7:43

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.