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
Katie ChristensenKatie Christensen 

Image on Customer Portal not displaying

Hello,

I've created a VF page and controller to display an image on the home page layout to our portal users. The image
displays as expected for internal users but I am struggling with making it visible to the portal users. The image is stored in Documents and I¹ve confirmed that it's externally visible but it's still presenting errors.

Class
public with sharing class WebChatController {
 public String imageURL{get;set;}
   
  public WebChatController()
  {
    imageURL='/servlet/servlet.FileDownload?file=';
    List< document > documentList=[select name from document where 
                                    Name='WebChat'];
   
    if(documentList.size()>0)
    {
      imageURL=imageURL+documentList[0].id;
    }
  }
}

VF Page
<apex:page controller="WebChatController" showheader="false" sidebar="false">
    <apex:form >
      <apex:image url="{!imageURL}">
    </apex:image></apex:form>
</apex:page>

Any suggestions?

Thanks in advance,
Katie
JLA.ovhJLA.ovh
Check the Folder visibility where you stored the image.You should grant access using a Group where you put the Sites guest user, and add that Group to the folder
Katie ChristensenKatie Christensen
Yes, I had also confirmed that the Document folder was marked as visible to all users.