0

I am having a little trouble displaying images that are hosted externally from SF.

I want to be displaying images from a main site on an internal page but i can't seem to get the images to display.

<apex:image value="http://rentleasebuy.co.uk/Vimages/18492.jpg"/>
<img src="http://rentleasebuy.co.uk/Vimages/18492"/>
<img src="{!URLFOR("http://rentleasebuy.co.uk/Vimages/18492.jpg" )}"/>

thses are the ways i have tried,

https://rentleasebuy.co.uk

Is the remote site url in the Remote Site Settings.

I hope i'm not going crazy and this is possible. Cache has been cleared.

  • 1
    I believe that the http requests get mapped to https ones and so if the image isn't available over https you will get nothing. (Check your browser'a Network tab to see what request is being made.) Not sure where this is described/explained though... – Keith C Jan 29 '18 at 14:54
  • I'm guessing that's what the console error of, Err_Insecure_reponse is about then. The host isnt https(Yet). So guess i need to try again once it becomes https – TimChadwick Jan 29 '18 at 14:57
  • You are right, Used our current site that also holds the images but is https and worked instantly. If you want to type that up as an answer i will mark it as correct – TimChadwick Jan 29 '18 at 15:03
  • Added an answer. Feel free to accept someone else's answer though if they can explain better and link to some official docs... – Keith C Jan 29 '18 at 15:05
2

I believe that the http requests get mapped to https ones and so if the image isn't available over https you will get nothing. (Check your browser'a Network tab to see what request is being made.)

Not sure where this is described/explained/justified though...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.