question

ChrisHornCristabel-6040 avatar image
1 Vote"
ChrisHornCristabel-6040 asked ScottPalmer-8383 commented

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.

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ChrisHornCristabel-6040 avatar image
0 Votes"
ChrisHornCristabel-6040 answered ElsieLu-MSFT commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ChrisHornCristabel-6040 ,

Glad to hear that you have found a workaround, you could mark the answer as "Accept Answer" which will help other users see the effective content directly.

Any updates or follow-ups are welcomed to post here to share with us.

Thanks,
Elsie Lu



1 Vote 1 ·
ElsieLu-MSFT avatar image
0 Votes"
ElsieLu-MSFT answered ScottPalmer-8383 commented

Hi @ChrisHornCristabel-6040 ,

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:
123531-28.jpg

123474-27.jpg

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.


28.jpg (12.3 KiB)
27.jpg (101.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

""...and will not make changes to your documents.."

WRONG. SharePoint intentionally and silently modifies word documents when they are uploaded. This caused me no end of grief today as I tried to figure out why my check-summed files would become "corrupt" after syncing to SharePoint. This basically completely broke my ability to share these files with colleagues via SharePoint as the software involved checks for data corruption.

0 Votes 0 ·
ChrisHornCristabel-6040 avatar image
1 Vote"
ChrisHornCristabel-6040 answered

If I create a word document with next to nothing in it. Then upload that document to my Sharepoint directory. The file size increases, and if I download it again, it is now different. Opening the downloaded file I can see in the properties that the following entry has been added to the file. I really don't want Sharepoint modifying files on upload. I see this behaviour when using the web front end, and also when using the MS Graph API. Is there a way to prevent this?

123699-screen-shot-2021-08-17-at-104959-am.png
123700-screen-shot-2021-08-17-at-105311-am.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.