Tuesday, November 8, 2011

SP2010 : Validating file name before uploading in code

Scenario:
I wrote another blog post file name and folder name restriction in sharepoint.

and how can you clean a file name cleaning-up-file-names-for-uploading

With a new client we had similar requirement and I discovered a new way to validate filename in SP2010. Also there are many other helpful methods.

Solution:

SPUrlUtility.IsLegalFileName(filename);

0 comments: