Reputation: 199
I am trying to download image from HTTP URL to my computer via c#. Example picture: http://www.hcs.harvard.edu/csharp/Logo1.png
I am using cURL to fletch it. Then I am saving it to computer as picture.jpg, but the file is corrupted. It is not recognized as picture
What is the correct way of doing this ?
Thanks
Upvotes: 0
Views: 1795
Reputation: 12348
Why not use System.Net.WebClient for this?
WebClient client = new WebClient();
client.DownloadFile("http://www.hcs.harvard.edu/csharp/Logo1.png", "Logo1.png");
Upvotes: 5
Reputation: 12993
I don't completely understand the question, but my first thought is that saving a .png as .jpeg would be a good place to start investigating.
Upvotes: 4