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
SunilKumar.ax1648SunilKumar.ax1648 

Any one have any Idea - How to download the document from force.com sites for custom coding?

Hi All,

 

 

I have a visualforce page on which I am accessing the document using the "servlet/servlet.FileDownload?file={!docId}". But the problem is this, this is accessing publicly. I want to authenticate this with my own custom login cretentials. So, is there any logic that open the document file as download link, or without accessing the given URL, we would get the document.

please post a solution asap.

bob_buzzardbob_buzzard

I'd handle this using content deliveries - that allows you to provide a URL to view/download the document, and you can specify a password that must be entered to access it.

SunilKumar.ax1648SunilKumar.ax1648

Thanks for your reply

 

please post any details. or code

bob_buzzardbob_buzzard

Look in the help for content deliveries.  When you create one of these it generates a URL.  You can then use this URL in the same way that you do the download servlet.

 

Content deliveries aren't exposed through the API, so I don't have any code.