tags:

views:

55

answers:

1

How do I take an image from an url and save it locally?

http://someurl.com/imagename.jpg -> c:\apppath\imgfolder

ASP.NET C#

I am not very good with IO stuff, hope someone can help me out :)

+5  A: 

Try this.

System.Net.WebClient wc = new System.Net.WebClient();

wc.DownloadFile("http://www.domin.com/picture.jpg", @"C:\Temp\picture.jpg");

Since you've tagged this with ASP.NET, it's worth pointing out that if you put this code in your ASP.NET Website/Web Application, you'll need to make sure the the Identity/Account that your application is running as, has permission to write the file to the file system.

Eoin Campbell
Really elegant solution, thanks
The real napster