I am working on a web application. Here I am storing attachments/uploads on server physical directory. The parent folder of uploads may contain special characters like '?'
Example of URL
"~/ChapterFiles/Capgeminisdfsdf_BE CSE ?_CoverPic/CoverPic.jpg"
When I am doing, Server.MapPath()
on this URL, I am getting an error "Illegal characters in path."
Can't remove question mark from folder name as it's part of requirement. Please suggest a solution, I need to fix it urgently.