+ Start a Discussion
sfdc18sfdc18 

Render attachment on visualforce page based on file extension

Hi,

How to render attachment on visualforce page based on file extension.
Also how to download attachment from visualforce page without attachment as standard controller.
Ashish_SFDCAshish_SFDC

Hi Mayur, 


The code for PDF and msWord is different and does not fall under the attachments based on file type. 

See the below links for PDF and Word, 

Rendering a Page as a PDF
http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_renderas_pdf.htm

render VF page as word document
https://developer.salesforce.com/forums?id=906F000000095xXIAQ

How to download a VF page as PDF and email it from a trigger?
http://salesforce.stackexchange.com/questions/1302/how-to-download-a-vf-page-as-pdf-and-email-it-from-a-trigger

How do I convert a visualforce page to a PDF?
http://salesforce.stackexchange.com/questions/5605/how-do-i-convert-a-visualforce-page-to-a-pdf/5607#5607

Visualforce Force Download of PDF or Other Content
http://iwritecrappycode.wordpress.com/2013/08/28/visualforce-force-download-of-pdf-or-other-content/


Regards,

Ashish