Hi,
I am trying to implement a SharePoint 2010 feature that blocks documents from being added to a document library depending on a custom document property in the (Microsoft Office) document. So far, I have tried to create an ItemAdding Event Receiver that parses the document, checking its custom properties against library to either allow the document to be inserted to cancel the insertion.
The only way I have found of getting the file into memory at this stage is the post at:
http://williamvanstrien.blogspot.co.uk/2011/10/read-content-of-uploaded-file-within.html
A major problem with this approach is that the HttpFileCollection item is empty when the receiver is triggered by a save from within a Microsoft Office application.
Can anybody help with a solution, or possibly a completely different approach to the problem?