If the user provides the url path to the image, i want to be able to try and download it with with a Webclient. I am using a httpresponse to check the file. Is there a way to grab 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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With