+ Start a Discussion
V AnandV Anand 

Insufficient privillages error for attachments



I have created a website with customer portal enabled. Now I want to download attachments of perticular contacts from site. I got this error   Error: Insufficient Privileges

I am using apex for displaying attachments my code is

 n = [SELECT id,name,contenttype,isprivate FROM Attachment WHERE Isprivate=false and ParentID=:Apexpages.currentpage().getparameters().get('id')];
             if(n.size() > 0)
               renderlist = true;
               return n;
        public Boolean getRenderlist(){ 
           return renderlist; 


<apex:dataTable value="{!notes}" var="cont" width="60%"  cellpadding="10" cellspacing="5" border="0" style="font-family:arial;font-size:14px"  rendered="{!renderlist}">
             <h1 style="font-family:arial;font-size:16px;color:red">Attachments</h1>
             <apex:column headerValue="File Name" value="{!cont.name}"  headerClass="headervalue" />
             <apex:column headerValue="Type" value="{!cont.contenttype}"  headerClass="headervalue"/>
             <apex:column headerValue="Content"> <a href="{!URLFOR($Action.Attachment.Download, cont.Id)}" >View</a> 
             <!--<apex:outputLink value="/servlet/servlet.FileDownload?file={!cont.id}" style="font-family:arial;font-size:14px:font-weight:bold;"> View</apex:outputlink>--></apex:column>  


 and I set contact : read on profile permissions.

But still I am getting this error anyone please solve my problem.