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
AKS018AKS018 

Insufficient previlages issue while downloading attachment through salesforce site

Hi,

 

  Here I have created site.  In visualforce page I have given facility to download the attachment.like

 

<apex:outputLink value="{!URLFOR($Action.Attachment.Download, attach.id)}" target="_blank"  style="text-decoration:none;">Download Consignment note</apex:outputLink>

 

It is not working in sites.

 

Is there any other way to download attachment through sites

Best Answer chosen by Admin (Salesforce Developers) 
AKS018AKS018
The Above code What I posted is correct, But in my organisation I have changed the sharing setting for the attachment parent object to public Read only. Now it is working in sites also.

All Answers

kiranmutturukiranmutturu

try to give the access to the parent object for site user which is referencing in the attachment parentid field... and try...

AKS018AKS018
The Above code What I posted is correct, But in my organisation I have changed the sharing setting for the attachment parent object to public Read only. Now it is working in sites also.
This was selected as the best answer
deepabalisfdcdeepabalisfdc

Please check at Site - Public access settings - Standard Object Permissions -  Documents object permission is given.