Unlike in Windows explorer, if you delete/rename the htm file (even purge from Recycle Bin) in Sharaepoint, the supporting folder will NOT be renamed or deleted. If you try to rename the folder by calling MoveTo( string newFolderName ) method, you will receive this error message: “You cannot copy or move a thicket file. To change the file name or create a copy of the file, open the file and save as to a new name.“ The rule is that none of the previous folder name or new folder name can ended with ‘_fiels’ keyword. So, how do you rename such a folder to another name?
OK, how about to create the new _files by the new htm name, then move the files/subfolders over, then delete the old one? Well, you will receive the same error message. OK, then how about create another temp folder with a regular name and use it as a transit folder? A little better – the sub folders are OK but the files directly under it will still give you same error message.
Final workaround: create a local working folder and download the content, then create new folder at Sharepoint and re-upload everything, finally delete the old folder. This seems the only solution.
In my project, I came up with a better idea after wasting almost 2 days – I simply delete the old file and _files folder, and use another existing module to upload the new file.