1

When this code is ran it opens the file successfully

var documentId = component.get('v.download').Content_ID__c;
$A.get('e.lightning:openFiles')
    .fire({
        recordIds : [documentId]
    });

When the file preview opens there is a menu bar on the top right with a download button. enter image description here

When this is clicked nothing happens. In the console a warning, and an error is logged

Warning

WARNING: Event.setParams(): 'inContextOfComponent'('forceContent:modalPreviewPlayer') is not a valid parameter. Valid parameters are 'recordId', 'allowPreview'

Error

Spa.js:211 Blocked opening '' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.

This feature was working while it was on a persistent page, but I moved the link that calls the above JS to a modal that is rendered in between aura:if tags. The modal stays open in the background when the file is opened.

This is using a Chrome browser.

1

The issue is that I was testing this through the Community Builder Preview. When I deploy this to users and test it works as intended.

If you run into this issue just quickly deploy it to the users and test with a test community user.

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.