title: C# Download Data using Web Client
body: <p>I'm having an issue downloading a file.  I'm running this website on my local IIS.  The BaseUrl correctly has the address of my local IIS site.  The moduleImgPath is a Sitecore media item:  "/sitecore/shell/~/media/Racking/module-image.png".  The BaseUrl has the structure <code>"http://local-$company.com".</code></p>
  
  <p>The code used for the download is essentiall shown below.  The method errors on Image.FromStream() with a System.ArguementException - "Parameter is not valid."</p>
  
  <pre><code>        Stream stream = new MemoryStream(new WebClient().DownloadData(RackingConfigHelper.BaseUrl + moduleImgPath));
  
          Image objImage = Image.FromStream(stream);
  </code></pre>
  
  <p>My question essentially revolves around - can you use a WebClient this way, to download data from what essentially a local source?  Or will I need to deploy this code to my test environment to test it out?  If I can, do I need to worry about ports?  </p>