Posts

Showing posts from August, 2015

Validate SharePoint Special Characters on File Upload name - C#

You cannot use the following characters in a document name when you upload the document in SharePoint Site o    Number sign (#) o    Tilde (~)   o    Percent (%) o    Ampersand (&) o    Asterisk (*) o    Braces ({ }) o    Backslash (\) o    Colon (:) o    Angle brackets (< >) o    Question mark (?) o    Slash (/) o    Plus sign (+) o    Pipe (|) o    Quotation mark (") Here is the method to check that the documents contains any special characters     protected bool IsValidFilename(string fileName){               string pattern = "[\\~#%&*{}/:<>?|\"-]";               try               {                   if (...