We currently have a solution that captures the file name from a URL using this
currentFile = Path.GetFileNameWithoutExtension(url);
We found that if there are query strings that include characters such as quotation marks, they return with an illegal character error in the path.
For example, if the URL
http:\\myurl.com\mypage.aspx?utm_content=This+Is+"Broken"
Then it will not get the file name. Is there a better, cleaner way to get "mypage"?
source
share