function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mikhail RzhevskyMikhail Rzhevsky 

Get sf site url from community

Hello.

I have lightning component, working on community page and need to get reference to the main salesforce site for get link to download content form ContentVersion. Link must be like this

var documentId = "https://study-####--####.lightning.force.com/sfc/servlet.shepherd/document/download/";

I tried a lot of variants from URL class like getHost(), getPath(), getRef(), getSalesforceBaseUrl(), getCurrentRequestUrl().

But I can only get component's url  from controller of community it is like this

https://conf-######.##70.force.com
If you have any ideas,please share it.