Ended up working out a work around for creation and updates, first name the file via the Graph API to a random string with no file extension. Then upload the file and set any field values as required. Then as last step rename the file back to the original name. When needing to do any sort of update to sharepoint list fields or to update the contents of the file. Firstly rename the file back to a file with no extension, random string again in this case. Apply any updates, or new file content. Then lastly rename the file back.
Sharepoint Modifying Internal File Structure of Word Document on Upload
Sharepoint appears to be modifying the internal structure of uploaded word documents. Visibly the file on re download looks the same, however the file size has increased in size and certain sections of the file when doing a binary compare are different. Has anyone come across this before or know why Sharepoint might be doing this. We have a process that requires that the file size on upload matches afterwards but this is failing due to sharepoint modifying the file. Only happing on some files we are migrating to sharepoint.
Microsoft 365 and Office SharePoint For business Windows
2 additional answers
Sort by: Most helpful
-
Elsie Lu_MSFT 9,801 Reputation points
2021-08-16T07:22:00.083+00:00 All of content in SPO is encrypted & stored in the SharePoint content databases (on Azure SQL storage) in the appropriate data center.
SharePoint Online is a product designed to facilitate users to store and better manage documents. It is very cautious about the management of permissions, and will not make changes to your documents, please don't worry.
One example:
Or is your issue that your file migration failed during the migration process? Are you using SPMT to migrate files?
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
Paul de Jong 806 Reputation points
2025-06-25T12:06:23.0966667+00:00 The root cause is the property promotion mechanism in SharePoint that modifies Office files, emails (eml and msg) and tiff files. SharePoint adds schema (xsd) information, custom columns and the content type details into the file. This results in a small file size increase (several kB's) but also means checksums become useless.
It can only be disable on a tenant level afaik.
The workaround by using a random name without extension by-passes the property promotion. Nice workaround.