0

I've created a Flow with a File Upload Component which works perfectly when ran as Flow. However, when I'm running the flow, via a visualforce page, the file upload component doesn't work as expected. Actually, after selecting the files to upload, no files get uploaded.

enter image description here

This VF page is public and will allow anyone that has the public VF page link, to upload files.

As I'm quite a rookie, I've used the SF render lightning documentation.

My code is quite basic and based from documentation mentioned above:

<apex:page lightningStyleSheets="true" showHeader="false">
<html>
<head>
    <apex:includeLightning />
    <apex:slds />
</head>
<body class="slds-scope">
    <div class=" darken " style="background-image: URL(https://xxxxxxx.content.force.com/servlet/servlet.ImageServer?id=0158E0000016MvP&oid=00D8E0000000xPX&lastMod=1572614979000);background-repeat: no-repeat !important;background-position: center top!important;padding-top: 150px;padding-bottom: 300px;width: 100%;overflow: hidden;">
    <br/><br/><br/><br/><br/><br/>
    </div >
    <div id="flowContainer" />
    <script>
        var statusChange = function (event) {
               if(event.getParam("status") === "FINISHED") {
                  // Control what happens when the interview finishes

                  var outputVariables = event.getParam("outputVariables");
                  var key;
                  for(key in outputVariables) {
                     if(outputVariables[key].name === "myOutput") {
                        // Do something with an output variable
                     }
                  }
               }
        };
        $Lightning.use("c:LightningFlowApp", function() {
            // Create the flow component and set the onstatuschange attribute
                $Lightning.createComponent("lightning:flow",{"onstatuschange":statusChange},"flowContainer",
                    function (component) {

                        // Start an interview in the flowContainer div, and 
                        // initializes the input variables.
                        component.startFlow("MyFlow");
                    }
               );
            });
    </script>
</body>
</html>
</apex:page>

LightningFlowApp

<aura:application access="global" extends="ltng:outApp" >
    <aura:dependency resource="lightning:flow"/>
</aura:application>

Could it be that I have to add something in statusChange event in order to handle the files? If so, how shall I proceed?

Looking forward to hearing from you.

0

As per docs, It is very clear that file upload component is not supported in Lightning Out or standalone apps, and displays as a disabled input.

enter image description here

As you are trying to use lightning out, hence it does not working for you.

| improve this answer | |
  • Maybe confusing but I'm using the Flow File Upload component and it doesn't show up as disabled. – poypoy Feb 27 at 11:34
  • Ahh, I thought it is Aura. Can you update your question to make it clear – sanket kumar Feb 27 at 11:37

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.