Reputation: 2324
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 :)
Upvotes: 0
Views: 874
Reputation: 44308
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.
Upvotes: 6