I have publicly accessible files in Salesforce (accessible by anyone, even without a Salesforce license), which can be accessed via URLs such as this:
However, this is a page that displays the file with a download link. I would like to have a link to the file itself, without any HTML wrapping it. With googling I found that there are links like
that should do that, but they require a Content Version record Id, which always starts with 068. As you can see, the original URL does not contain something like that. Is there a way to programmatically derive the second URL from the first URL?
UPDATE: Yrc Shk suggests to use the DistributionPublicUrl object. Creating such an object from a ContentVersion gives you several URLs:
Where DistributionPublicUrl is the URL that I started with, the page that allows you to download a file. The other two URLs appear to be the ones linked to the two Download buttons on that page.
But what I am really looking for, I'll say it more carefully now, is a URL to a page that displays just the file, without an HTML wrapper, without automatic downloading (a user might choose to download using the browser).