Click here to Skip to main content
14,937,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Good Morning,

Id like to know how to link images from 1 website to another, and if i update the image from the main website that it will automatically update the image for the alt websites.

For example;
Main Site: Image1
Alt Website: Image1

I want to change Main Image 1 to Image 2 but i want Alt image 1 to automatically change to Image 2.

Thank you very much.

What I have tried:

Saving the image as the same name, however the problem would be that it will override in the end of the day.
Posted
Updated 18-Jun-18 3:30am
Comments
Mohibur Rashid 18-Jun-18 3:31am
   
How does the alt site gets the file name? I hope it's not magic.
If that information is hard coded. Then you need to do the hard coding. If there is a mechanism using which server can update their required, then you need to follow that. For example, they can have shared system to retrieve image information. Such as Database, accessible configuration file that can share that information, or perhaps magic!
Member 13876306 18-Jun-18 8:01am
   
That really doesn't answer my question at all, but thank you for trying.
Mohibur Rashid 18-Jun-18 18:06pm
   
That was not an answer. That was a question

1 solution

Why can you not simply create the link from the source website to the target website? If they change the image (and its name remains the same) then it will just simply update yours, too.

If they update and change the name - then you're shooting in the dark. If you can grab their page and screen-scrape for the images then you can update your values with theirs. You'll need some way to tell the images apart. If in DOM, and nothing on the page changes location, then you can get the list that way (iterating the array of all <img> entities. If they had ID's then life would be easier (unless those change, too).

If the remote is out of your control - you can only hope. If it's in your control, then you have the answers in advance.

   
Comments
Mohibur Rashid 18-Jun-18 18:09pm
   
Simply using an image link has issue with caching

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900