Home:ALL Converter>C# Download Image from Url to NO specific folder

C# Download Image from Url to NO specific folder

Ask Time:2017-09-28T13:41:07         Author:Julian

Json Formatter

I need to download images from my SharePoint site. I have a button which gets the URL of the image above it, to download it. But I want that the Users can choose, where he wants to store the images. So how can i download an image from the Url without setting a specific folder?

I just know methods like: webClient.Downloadfile -> Needs a Path to save Image.Save -> Needs a Path to save

I am searching for something like you right click an image in your browser and it says "Save image as" thats exactly what i want

My code where i tried to choose the download folder (I get a 403 FORBIDDEN error):

WebClient client = new WebClient();            
        client.Credentials = new NetworkCredential("*******", "******", "**");
        client.DownloadFile(new Uri(string.Concat("http://******/apps/bilddb/PrivateStore/", item.FileName)), String.Concat(@"C:\Users\", System.Security.Principal.WindowsIdentity.GetCurrent().Name, @"\Downloads"));

Author:Julian,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/46461730/c-sharp-download-image-from-url-to-no-specific-folder
yy