views:

531

answers:

2

I have an aspx page,where the user will enter a valid image url(ex : http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png). I need the program to upload this image to the Server. How can i do this ?

+2  A: 
System.Net.WebClient webClient = new WebClient();

webClient.DownloadFile(@"http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png",
@"c:\path\localfile.png");

You can use Server.MapPath to get physical directory on the server corresponding to the relative or virtual path, for example Server.MapPath("~/Images")

CMS
leen3o
A: 

I want to do some resizing(changing width & height) in the image before uploading to server. Can I load it into a Bitmap object.I am getting a "URI not supported error" when i trying to do so