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

Document as Staic Resource

Can we only reference image and includeScript in Visualforce page ?


In the static resource called HelpDocuments if I upload a Document I don't see anything in the page, if i upload an image, i see that image.


<apex:page >
    <apex:image url="{!$Resource.HelpDocuments}"/ >


How can i show the document uploaded as a Document in the visualforce page?






Using image tag i think you can only render images on the page not the documents.
Thanks for your resposne. I see that, but my question can a static resource be a document. I have a Crearted a visualforce page tab for 'Help and FAQ' and that's the reason why I want to reference a PDF or Word document. Does anyone have suggestions how else i could reference my Help/FAQ files.



You can keep doc file in static resource but cannot show on page. As there is not any tag to show file on page.

When ever only img tag to show images and all other tag like script and for style sheet tag for reference for file in Static Resouce. You can give the reference of that file for download.



Ashlekh Gera.


Thanks. I guess i will skip the static resource. Keep the files in Documents and provide links.
You can either have a object for FAQ's. store your Questions and Answers in that object. Create a page which retrieves questions and answers form object and display it in the page. So in future when you want to add new questions you can just add them in the object directly and they will display in the page without any change in the code.



Yes you can keep the file in Document Folder or can attach with attachment object (Notes & Attachment object can be child of every object)

So keep the file in that objects and give the link to user for download.





you can give me kudo's if I helped you in any way.



Well PDF are supported by most of the modern Browsers, If you want o dispay the PDF in page you can consider the object tag


<object data="{!$Resource.HelpDocuments}" type="application/pdf" height="600px" width="100%" >
     <param name="view" value="fitH" />


Thanks everone for the suggestions. Much appreciated.