Im sarching how to create a safe filename in my webapplication I had read a lot of post around here last one http://stackoverflow.com/questions/62771/how-check-if-given-string-is-legal-allowed-file-name-under-windows but I can't find the solution for this example when the filename comes in the way "fileName ..pdf" (double dot), the browser can't open the file at least IE and is a safe filename at least for windows,so how can I search for this exception and remove the double dot, what I have by now is the following example (which obviously doesn't remove the double dot:
foreach (var c in Path.GetInvalidFileNameChars()) { fileName = fileName.Replace(c, '-'); }