Skip to main content
Solved

Showing an alternative (local) picture for a nonexistent external picture


Ricky
Superhero
Forum|alt.badge.img+8

Hi,

We have a product database in which we like to show the picture of said product ((preferably) straight) from the suppliers website/webserver. Sometimes the supplier had a picture available, but for some reason it is no longer available. In that case we would like to show an alternative (local) picture.

Is there a way to know when the request for the suppliers picture has failed (i.e. no content, 404 etc…) and we can action that somehow with a follow up and provide another URL? (i.e. http://myindicium.nl/no_image_available.png

rgds Ricky

Best answer by Mark Jongeling

Good point, that is indeed then not possible. We think this is better to implement as part of the model itself, being able to have a sort of fallback image for the previewer. Could you make an Idea for this? Thanks!

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

3 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23

Hi Ricky,

Indicium does not have this functionality currently but it is something that could be made in the future.

Luckily there is a workaround/solution. IIS does support redirecting of requests, so what you could do is if a request is made to find a picture but the website returns a 404, that you then redirect to a local website/picture/file and show that. Would that suffice? 


Ricky
Superhero
Forum|alt.badge.img+8
  • Author
  • Superhero
  • 96 replies
  • July 9, 2021

The IIS redirecting will not work because the client is making requests straight to the suppliers website - and that would be the place to put the redirect on - but that’s not my server, its the supplier one :-)

---

If the client gets a 404 in return and we could action that, then we would be able to say to the client ‘Hey you got a 404 for this image right? - instead get this local http://indicum.nl/not_found_image.png’ - but I don’t know how to action a 404 caught by the client (My guess it isn’t possible, since for example a html component only fetches the given URL and that is about the only action you get)


Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • 3936 replies
  • Answer
  • July 9, 2021

Good point, that is indeed then not possible. We think this is better to implement as part of the model itself, being able to have a sort of fallback image for the previewer. Could you make an Idea for this? Thanks!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings