title: Copy image from server to my server using its URL C#
body: <p>I'm trying to copy image from onther server to my server using image url. and here is my code</p>
  
  <pre><code> internal Boolean changePhoto(int userID, string imagePath)
      {
          Boolean success = true;
  
          try
          {
              string fileName = Convert.ToString(userID) + ".jpg";
  
              var currentApplicationPath = HttpContext.Current.Request.PhysicalApplicationPath;
              currentApplicationPath += "/Images/profiles/";
  
              var fullFilePath = imagePath;
  
  
              // Get the destination path
              var copyToPath = currentApplicationPath + fileName;
  
              // Copy the file
              System.IO.File.Copy(fullFilePath, copyToPath,true);
          }
          catch (Exception ex)
          {
              DAO.exDao myDao = new DAO.exDao();
              myDao.insert(ex);
              success = false;
          }
  
          return success;
  
      }
  </code></pre>
  
  <p>But i have an exception which is</p>
  
  <pre><code>URI formats are not supported.
  </code></pre>
  
  <p>The previous method take the user id that will be the file name and take the source of the image that will copy to my server, and when i call it the exception appear.</p>