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

Trying to build a URL for a Content Document on a Sites page...

The query below that returns everything I need to build a list of Content Documents for a given ContentWorkspace. What I can't seem to do is build a URL, using the ContentDocumentId, that will allow for downloading of the document in a Sites VF page.




Select Id, ContentWorkspaceId, ContentDocumentId, CreatedDate, SystemModstamp, IsOwner, IsDeleted,
ContentDocument.Id, ContentDocument.Title, ContentDocument.PublishStatus
From ContentWorkspaceDoc
Where contentWorkspaceId = '058500000004COF' and ContentDocument.PublishStatus ='P'
order by ContentDocument.Title



If I deliver the Content Document I get a URL that I can create a link with but I do NOT see that Id used in the link below in my query at all. The link looks like this.

<a href="">My Doc</a>


Any help or pointers in the right direction would be greatly appreciated.






it appears as if you got this working? Do you mind sharing your solution?


My mistake, I didn't realize you created an actual content delivery, I thought you meant you output the query results to the page...