SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the SharePoint Client Object Model to get information from a SharePoint 2010 document library to be able to delete old htm-files located there. The problem is that these htm-files have hidden "_files"-folders associated to them. I am not able to find these folders using the SharePoint Client Object Model, they just don't show up. I can see them in Windows Explorer using WebDav, but not in SharePoint. They don't get deleted if I just delete the .htm-file.

 using (ClientContext context = new ClientContext(webUrl))
            Web web = context.Web;
            context.Credentials = System.Net.CredentialCache.DefaultCredentials;
            Folder fldr = web.GetFolderByServerRelativeUrl(serverRelativeFolderUrl);
            foreach (Microsoft.SharePoint.Client.Folder folder in fldr.Folders)
            { // no hidden folders found here, only usual folders
share|improve this question

According to and you shouldn't be able to upload the folders without getting renamed to *_files_. Are the folders there without the trailing underscore?

If yes, and you somehow really created thickets you won't see them - they won't reveal as they are beliefed as "internal" and never be listed in the OM. You can still delete them though:

SPFolder folder = web.GetFolder("Documents/google_files")
//while folder.Exist is false the folder could still exist but be hidden

This won't throw an exception if the folder is not found and delete if it exists.

Edit, after finding out that you are searching for a method to do this automatically

You could create an EventReceiver that handles the situation of a file getting deleted and delete the ticket folder to the .htm file accordingly. In the example on they are canceling the ItemDeleting event, you just have to catch the event occuring in the libraries you want (The event will fire on all items in a web) and delete the thicket.

Just a hint when doing so, Sharepoint Manager ( is a great tool that helps you stumbling through the objects on your SharePoint. It has done a great job for me when i was deploying features and custom Receivers into SharePoint.

share|improve this answer
I am able to upload the thickets without them getting renamed, using the SharePoint Webservices. This also is the behaviour I want. The issue is that the .htm-files were deleted using the SharePoint website, so if I want to delete the _files I would need to find the folders as I don't know the .htm-file anymore. Our current workaround is a manual webdav-search. This also has the disadvantage of the files being in the recycle bin for 30 days after deletion - the web frontend is not able to delete these 1000s of files from the bin without timing out. – Compufreak Jul 29 '14 at 11:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.