title: Accessing image from other server
body: <p>I have image file placed on the one server and application on other server.</p>
  
  <p>I want to access that image, below code I have written:</p>
  
  <p>On default.aspx, I have</p>
  
  <pre><code> &lt;asp:Image ID="Image1" runat="server"  ImageUrl= "GetImage.aspx?imgName=MyImage.jpg" /&gt;
  </code></pre>
  
  <p>and on GetImage.aspx, I have written the below code on page_load</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
      {
          // Changing the page's content type to indicate the page is returning an image
          Response.ContentType = "image/jpg";
          var imageName = Request.QueryString["imgName"];
          var path = "//SERVER/FOLDER/" + imageName;
  
  
          if ((string.IsNullOrEmpty(imageName) == false))
          {
              // Retrieving the image
              System.Drawing.Image fullSizeImg;
              fullSizeImg = System.Drawing.Image.FromFile(Server.MapPath(path));
              // Writing the image directly to the output stream
              fullSizeImg.Save(Response.OutputStream, ImageFormat.Jpeg);
              // Cleaning up the image
              fullSizeImg.Dispose();
          }
      }
  </code></pre>
  
  <p>But I am getting error at </p>
  
  <blockquote>
    <p>fullSizeImg = System.Drawing.Image.FromFile(Server.MapPath(path));</p>
  </blockquote>
  
  <p>Please let me know where I am incorrect. Do I need to anything else other than Server.MapPath ? because my image is on other server.</p>
  
  <p><strong>EDIT</strong></p>
  
  <ul>
  <li>I have image folder in my computer</li>
  <li>I have created a web app in other computer [same network], deployed
  in IIS, image is displayed correctly. With path like
  <a href="http://10.67.XX.XX/websiteName/Default.aspx" rel="nofollow">http://10.67.XX.XX/websiteName/Default.aspx</a></li>
  <li>but when I am trying to access the same from my comupter or any other
  computer, I am not able to see the image.</li>
  </ul>