I have two different websites running on two different servers with URL say http://192.168.0.102:1004
and http://192.168.0.122:1005
.
Now i am trying to copy a image file from http://192.168.0.102:1004
to http://192.168.0.122:1005
using following code
if (File.Exists("http://192.168.0.122:1005/Assets/Images/Stores/14/14_Logo.png"))
{
File.Copy("http://192.168.0.122:1005/Assets/Images/Stores/14/14_Logo.png", "http://192.168.0.102:1004/Assets/Images/Stores/14/14_Logo.png", true);
}
But If
condition always return me false
. However if i copy this URL in browser, it render me desired image
on page.
If file exists, i need to copy it from source domain to target domain.
How to achieve this ?