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
saharisahari 

Attachments in customer portal

Hi. I am able to display all the attachments related to a customer portal user. But the problem is that, when user clicks on that attachment link to download, it says INSUFFICIENT PREVILIGES. Here is what I am using .

 

<a href="{!URLFOR($Action.Attachment.Download, att.id)}" >{!att.name}</a>

 

<a href="{!URLFOR($Action.Attachment.Download, att.id)}" >{!att.name}</a>

 

But the same works in a normal vf page that is for a normal contact withoutr any authentication.

 

Thanks for any help.

krishnagkrishnag

in this context the user u mean a guest user or a contact.

saharisahari

I am refering to a customer portal authenticated user

krishnagkrishnag

did u check the permissions for the portal user profile.

saharisahari

Yes I did.

The poratl profile has read access to contact obj.

 

hgarghgarg

Yes, I agree with you because We faced the same problem, on customer portal the direct attachment of a Contact are not visible.

However We cracked it by following way:

!) Created an another child object of the Contact say ContactAsset__c

2) and enabled attachment for this object.

 

Now the Attachments of ContactAsset__c are visible on customer portal. Hope it will work for you.

 

--

Hemant

PrakashGPrakashG

Thanks Hemant for this approach

 

One more approach we have by that we need not to create new Object.

>> created 1 Formula field and one Text field in Contact.

>> On Text Field I am storing Attachment ID and in another formula field i put URL text of that image like :-

"/servlet/servlet.FileDownload?file={!PhotoID}"

>> On VF show with <ApexOutputText>