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

How to get thumbnail images of attachments file

How can I get the icon for the file type of a file or thumbnail image files that are attached to the feed as a desktop application for chatter, what do I do?


The HTML is sent to the email digest of the chatter was obtained from the following URL.



While it is possible to get these images, just be aware that using them is not really 'supported' ie: today an image with a particular url might be there, tomorrow it might not. 


With that said, I am not sure the images in the Chatter desktop are sourced from the same place as via the web UI, but you could certainly add logic in your Visualforce page to retrieve an image using a relative URL (don't use absolute URLs as these will change between environments).


I would package your logic into a Visualforce component that you pass the file type of an attachment in as a param, with the logic of which url/image to serve, being encapsulated in the component.