Tuesday, April 20, 2010

Files missing in SharePoint? Even from RecycleBin and (god forbids) AllUserData?

If files are disappearing from your SharePoint Document Library and you are (probably) using some custom code on SharePoint Doc Libs then check if you have any SPFile.Delete() call because if so, that row will disappear from SharePoint for ever...Unless you have you Backup/Restore working on.

Developers should be aware that there is another method, .Recycle() that will send the file to the RecycleBin, and this is safer in most cases. Of couse if RecycleBin is disabled this method doesn't add any value i guess...

There are other cases that will delete the file for ever like sp workflow deletions but im not aware of more...probably those that internally use Delete().

There are some nice posts with more info on this @ sharemypoint, and its also good to read the SPFile documentation ;)

No comments: