Simplified Download Image Save to File System and Display on Page

By Peter Bromberg

This is an example of what is probably the least code to perform the requested operation

byte[] b = new WebClient().DownloadData("http://www.google.com/images/logos/ps_logo2.png");
System.IO.File.WriteAllBytes(Server.MapPath("ps_logo2.png"), b);
// Image1 is an asp:Image control
Image1.ImageUrl = Request.ApplicationPath + "ps_logo2.png";

Simplified Download Image Save to File System and Display on Page  (903 Views)