Skip to main content
Nintex Community Menu Bar
Question

File upload for Guest Site user on Exp Cloud Lightning (Aura)

  • April 8, 2025
  • 4 replies
  • 38 views
  • Translate

Forum|alt.badge.img+3

There are many posts about this, but they’re all pretty old and the architecture has shifted around quite a few times.

Pretty simple request with a lot of complexity underneath: I want an unauthenticated user to be able to create a custom object record, and then upload a file related to that record.

I’m trying to do this in a Lightning Aura Exp Cloud site (if I’m not mistaken, LWR is not yet supported).

I’ve got Skuid showing up and the fields in a form. File Upload is rendering - the only configuration that works is Content Document with no model selected. I cannot seem to figure out how to relate it to the record that’s being created.

I tried having the File Upload component inject a custom file name or description, which could then theoretically be used by a Flow or Apex to go find and then relate the two records on the backend, with system context. But no dice yet - the custom values do not get saved on the file in Salesforce.

Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 5 replies
  • April 15, 2025

It looks like this is a problem for folks even in Flow. From what I can tell, if I can get the ContentVersion Id from the uploaded file, and then create another record that includes that ContentVersionId and the record Id of the custom object that’s created, we could then use Apex or Flow to associate them after the fact.

https://salesforce.stackexchange.com/questions/396284/guest-user-unable-to-upload-file-from-flow

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 5 replies
  • April 15, 2025

Follow-up question: is there a way to get the record Id of the ContentDocument record that gets created as a result of the File Upload?

I’m sure there’s an API response from Salesforce somewhere that could be exposed; if I can store the returned ContactDocument Id on a field in the new custom object record, then Flow or Apex can take care of the rest, server-side.

Translate

Forum|alt.badge.img+13
  • Scholar
  • 514 replies
  • April 22, 2025

Hey,

My dev has accomplished a similar request, by using a VF page and iframing it on site

VF Page: 
 

<apex:page showHeader="false" sidebar="false" standardController="your_object__c">    <apex:includeLightning />    <!--Lightning Container-->    <div style="width:100%;height:100px;" id="LightningContainer"/>    <script type="text/javascript">    //get account Id from URL    var recordId = "{!$CurrentPage.parameters.id}";         //Create Lightning Component UploadFileVfpage    $Lightning.use("c:sampleAuraFromVF", function() {        $Lightning.createComponent("c:uploadFileComponent",                                    { "parentID" : recordId }, //Pass Parameter                                   "LightningContainer", function(component) {                                       console.log('Component created');                                   });    });    </script></apex:page>


then on a template field:
<iframe src="/apex/c__UploadFileVfpage?Id={{{Id}}}&isdtp=vw" width="100%" height="140px" frameborder="0"/>

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 5 replies
  • April 22, 2025

Dang. Ok. Welp, good to know. Thanks David!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings