• Sumit Kumar 10
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello Everyone,

I am using an lwc component on which users will upload a file and they can also preview that. For a preview, I am using navigationMixin and navigate the record to standard_namedPage which working fine for internal use but the same method is not working in the community. I am not able to preview the file using that. Today I did some research and get to know standard_namedPage not supported community and for that, I need to use standard_webPage which redirects me to the new tab and I can see my file there but the issue is on that new tab I can see my file as a thumbnail, not the actual file. Can someone guide me on how can I preview files in the community as the original file?
Below is the code that I am using for both internal and external.
 
Internal:
this[NavigationMixin.Navigate]({
type: 'standard__namedPage',
attributes: {
pageName: 'filePreview'
},
state : {
// assigning ContentDocumentId to show the preview of file
selectedRecordId:event.currentTarget.dataset.id
}
})

External:
//Getting content version id to assign the url.
contentVersionId = response;
var baseURL = 'https://'+location.host+'/';
var previewURL = baseURL + 'sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId='+contentVersionId;
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url: previewURL
}
}, false );

Thanks,
Arpit Jain
Several openings for Jaipur location, interested candidate please send your resumes at info@briskminds.com

1) Fresher (3 opening) - Must know Java, JS, HTML

2) Salesforce experienced developer (one opening for 2-3 years of experience) - Must have worked on Apex, Visualforce, Integrations, W/F, Approvals and a little knowledge on communities is preferred

3) QA (one opening for 2-3 years of experience) - Must know automated testing (say selenium)

Please do respond ASAP, we need to fill these positions before October. Spread this to your friends who may be interested.

Thanks
Ankit Arora
Briskminds Software Solutions Pvt. Ltd.
http://www.briskminds.com/