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.
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.