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
SSRS2SSRS2 

java.net.ConnectException: Connection timed out for PageReference.getContent()

I want to get Blob from external image URL but thrown exception.

 

Apex Debug Log :

 


System.VisualforceException: java.net.ConnectException: Connection timed out

see following sample code :

 

public PageReference testPageRefExternalURL() {
      PageReference pr = new PageReference('http://www.google.com/intl/en/images/logos/translate_logo.gif');
      try {
        Blob blobImage = pr.getContent();
      } catch (Exception ex) {
        throw ex;
      }
      return pr;
    }

   I have added 'http://www.google.com'  to 'Remote Site Settings' but still exception is thrown.If I save image in static      resource and get the URL it is work fine.

 

  -Suresh