Wednesday, June 20, 2012

Specific file or folder name is too long in sharepoint

Here is the issue while we upload files or create folder to sharepoint document library.

Usually get an error saying that "Specific file or folder name is too long".

Reason : Every sharepoint file name has limited number of characters, It will check for this condition before upload file to sharepoint.

Solution : Sharepoint object model has provided a beauty of way to check for the file name validity.

Here is the code :

SPUrlUtility.IsLegalFileName(filename);


It will return weather all the conditions are passed before upload it to sharepoint.

Thank you

2 comments:

  1. With Path too long error I use "Long Path Tool" to get fast and easy fix .

    ReplyDelete
  2. I suggest you try Long path tool is the very good program for easily delete, copy & rename long path files, error, unlock solution.
    Try it and solve your problem.

    ReplyDelete