Copy file from URI format path to local path
<p>I am trying to copy a file which is on a server and all I've got is it's URI format path.<br>
I've been trying to implement copying in C# .NET 4.5, but seems like CopyFile is not good with handling URI formats.<br>
So I've used IronPython with shutil, but seems like it is also not good with URI format paths.  </p>

<p>How do I get that file local?</p>

<pre><code>private string CopyFile(string from, string to, string pythonLibDir, string date)
{
    var dateTime = DateTime.Today;
    if (dateTime.ToString("yy-MM-dd") == date)
    {
       return "";
    }
    var pyEngine = Python.CreateEngine();
    var paths = pyEngine.GetSearchPaths();
    paths.Add(pythonLibDir);
    pyEngine.SetSearchPaths(paths);
    pyEngine.Execute("import shutil\n" +
                     "shutil.copyfile('" + from + "', '" + to + "')");
    return dateTime.ToString("yy-MM-dd");
}
</code></pre>

<p>I take all paths from xml config file.</p>

<p>With Python</p>

<pre><code>import urllib
urllib.urlretrieve("http://www.myserver.com/myfile", "myfile.txt")
</code></pre>

<p><a href="https://docs.python.org/2/library/urllib.html#urllib.urlretrieve" rel="nofollow"><code>urlretrieve</code></a></p>

<blockquote>
  <p>Copy a network object denoted by a URL to a local file, if necessary. If the URL points to a local file, or a valid cached copy of the object exists, the object is not copied. </p>
</blockquote>

c# python .net ironpython