+ Start a Discussion
Cool_DevloperCool_Devloper 

Can't we use standard Attachment View on a VF page?

Hi Friends,

 

One issue that i am facing to display the attachments related to an object on a VisualForce page is making me think that can we use the standard attachment View URL on a visualforce page.

 

URL is this:

 

https://cs2.salesforce.com/servlet/servlet.FileDownload?file=(FileName)

 

Can someone clarify this please??

 

Cool_D

 

PS: Whenever i use this link on my VF page, my URL gets broken in IE redirecting me to "https://cs2.salesforce.com/apex"

 

Best Answer chosen by Admin (Salesforce Developers) 
rtuttlertuttle
Try action="{!URLFOR($Action.Attachment.Download,attachmentidgoeshere)}" in a commandLink.

All Answers

QingsongQingsong
Cool_DevloperCool_Devloper

I am using AttachmentID only ....

 

just for reference i showed it as FileName in the dummy link.

 

It's working abs fine in Firefox .... dying out in IE :(

rtuttlertuttle
Try action="{!URLFOR($Action.Attachment.Download,attachmentidgoeshere)}" in a commandLink.
This was selected as the best answer