If the user provides the image path URL, I want to try and download it using the Webclient. I use httpresponse to verify the file. Is there a way to capture the file name to make it easier to save? Thanks
Try using the Uri Class to load the path and pull the file name from the Segments collection:
Uri uri = new Uri("http://www.domain.com/image.jpg"); string fileName = uri.Segments.Last();
I would consider using System.IO.Path.GetFileName for this:
string fileName = Path.GetFileName("http://www.abc.com/myimage.jpg");
Source: https://habr.com/ru/post/1369562/More articles:Which is better - SELECT TOP (1) or INNER JOIN? - sqlAssociating data with enumeration per command in Grails - data-bindingHow to embed java swing applet into website? - javaGrails link enumeration assembly - enumsjavascript array array - javascriptAndroid / GDB - Headaches - Cannot Find Debug Symbols - c ++disconnect Cm from RET - emacs301 Redirect problem, spaces on old URL? - http-status-code-301How to create a countdown timer using jQuery? - jqueryCalculating the angle between a horizontal and a line through two points - javascriptAll Articles