Skip to main content

Hello, I'm having an issue linking to an asset file via a link on a page in Experience Builder. I have some asset files (PDFs in this case) which are set to be publicly available to guests, and in Experience Builder I am creating a link to the file like this: href="/sfsites/c/file-asset/[APIName]". When a user clicks on the link, it'll download the PDF file.

 

All of this works fine, but what we noticed was that if you upload a new version of the file, the link in experience builder will ALWAYS download the first version of that file. One file we are looking at has 5 different versions, but the link in Experience Builder still only downloads the original version.

 

Is there some other way to link to the file so that it is always downloading the latest version using that url structure? I know I can use the {!contentAsset.ApiName.1} syntax, but would that also work if I have a link field in a CMS content type?

 

What I did notice is that if I go to Salesforce Setup and go to asset files, and I change the API Name of that file, the link will actually download the correct file.

 

Hopefully this makes sense, and I can try to clarify if not. Thanks!

13 commenti
  1. 12 lug 2021, 20:32

    @Jason Kilp absolutely it's intended to get the latest version if you don't specify the version number.  You don't need to include ?v= either, you can just keep the format /sfsites/c/file-asset/[APIName] 

0/9000