Upload goes fine - but when you try to open the file using Office you get the following errors:


The Office Open XML file
- Microsoft KB 928282 - Excel and Word related - not relevant
- Depressing news ...
Solution
SharePoint seems to have an error when adding documents to the filecollecting using the
SPFolder.Files.Add
function. If you add from a byte-array it simply fails with Office 2007 documents. But if you convert the byte-array into a stream, e.g. by saving the byte-array into a file and loading it into a stream, then it works. It's unclear to me why this error occurs - but Microsoft probably drops a single byte in the byte-scenario - which is critical for Office 2007 documents, but other documents seems to survive.
Input and comments very much appreciated.