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
Prashant GandhiPrashant Gandhi 

Alternative for {!URLFOR($Action.Attachment.Download, attachmentId)}

Hi,
I am tryng to preview and download a PDF through a vf page.
Here is the code snippet:
<div class="downloadpart">
                                    <apex:outputPanel rendered="{!(attachmentId!=null)}">
                                     
                                     <a href="{!URLFOR($Action.Attachment.Download, attachmentId)}','_blank'" class="btnbtn pull-left" >Preview</a>

                                    </apex:outputPanel>
                                    <a href="#" class="btnbtn centerbtn" style="text-align: center; margin-top:0px">Download User Manual</a>
                                    <a href="#" class="btnbtn pull-right" style="text-align: center;">Download Deposit Receipt</a>
                                    
                                </div>
 
it gives me an error stating insufficient privileges.
would appreciate if i can get help.
Vinod ChoudharyVinod Choudhary
Hi,

This is a permission issue as Sys Admin is able to download it. Would recommend you to check the user profile and its role.

Thanks