Thursday, May 24, 2012

How to strore Image from Image Control into folder Not from using File Upload Control


Some days back i came across this problem where i have to store Image into folder from Image control where Image are coming from some external link.so I would Like to share with you which might help you any day....

string filepath = Server.MapPath(img1.ImageUrl);
using (WebClient client = new WebClient())
{
         client.DownloadFile(filepath, Server.MapPath("Specify the path where you want to  store Image+imagename"));
         //For Example client.DownloadFile(filepath, Server.MapPath("~/Image/apple.jpg"));
}

0 comments:

Post a Comment