upload a docx file to the SharePoint library

%3CLINGO-SUB%20id%3D%22lingo-sub-2009195%22%20slang%3D%22en-US%22%3Eupload%20a%20docx%20file%20to%20the%20SharePoint%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2009195%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20upload%20a%20docx%20file%20to%20the%20SharePoint%20library%20so%20that%20no%20changes%20are%20made%20to%20it%20and%20the%20integrity%20of%20the%20electronic%20digital%20signature%20is%20not%20compromised%20(changes%20are%20made%20by%20adding%20custom%20properties)%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20will%20be%20a%20plus%20if%20you%20tell%20me%20how%20to%20achieve%20this%20with%20CSOM%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22file%20before%20it%20added%20to%20Sharepoint.PNG%22%20style%3D%22width%3A%20959px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242213i55E47261A273776E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22file%20before%20it%20added%20to%20Sharepoint.PNG%22%20alt%3D%22file%20before%20it%20added%20to%20Sharepoint.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22file%20after%20it%20added%20to%20Sharepoint.PNG%22%20style%3D%22width%3A%20946px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F242214i0879DA7F1815238E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22file%20after%20it%20added%20to%20Sharepoint.PNG%22%20alt%3D%22file%20after%20it%20added%20to%20Sharepoint.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2009195%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%202016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%202019%20On%20Premise%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%20Office%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2009349%22%20slang%3D%22en-US%22%3ERe%3A%20upload%20a%20docx%20file%20to%20the%20SharePoint%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2009349%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F909323%22%20target%3D%22_blank%22%3E%40berezovsky%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3ENice%20topic%3CBR%20%2F%3E1.%20Disable%20property%20promotion.%20Problem%3A%20this%20is%20a%20system%20wide%20setting%20and%20will%20likely%20not%20be%20acceptable%3CBR%20%2F%3E2.%20Place%20the%20docx%20file%20into%20a%20zip%20file%20and%20upload%20the%20zip%20file%3CBR%20%2F%3EThis%20may%20impact%20usability.%20It%20may%20only%20be%20useful%20in%20case%20of%20an%20archive%20where%20the%20docx%20does%20not%20need%20to%20be%20changed.%26nbsp%3B%3CBR%20%2F%3E3.%20Use%20encryption%20in%20the%20docx%20file.%20I%20am%20not%20sure%20if%20the%20property%20promotion%20is%20then%20prevented.%20you%20will%20need%20to%20check%20that.%20You%20then%20end%20up%20with%20making%20the%20password%20available%20to%20your%20users.%20and%20full%20text%20search%20will%20not%20work.%3CBR%20%2F%3E4.%20Upload%20the%20file%20with%20a%20different%20extension%20(that%20does%20not%20trigger%20the%20property%20promotion)%20and%20then%20change%20the%20extension%20afterwards.%20Not%20sure%20if%20this%20will%20circumvent%20the%20property%20promotion.%3CBR%20%2F%3EPaul%20%7C%20SLIM%20Applications%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Is there a way to upload a docx file to the SharePoint library so that no changes are made to it and the integrity of the electronic digital signature is not compromised (changes are made by adding custom properties)?

 

It will be a plus if you tell me how to achieve this with CSOM

 

file before it added to Sharepoint.PNGfile after it added to Sharepoint.PNG

1 Reply

@berezovsky 
Nice topic
1. Disable property promotion.
    Problem: this is a system wide setting and will likely not be acceptable.
2. Place the docx file into a zip file and upload the zip file
    Problem: this may impact usability. It may only be useful in case of an archive where the docx does not need to be changed. 
3. Use encryption in the docx file.
    I am not sure if the property promotion is then prevented. You will need to check that. You then end up with the challenge of making the password available to your users. Also keep in mind that full text search will not work.
4. Upload the file with a different extension (that does not trigger the property promotion) and then change the extension afterwards. You will need to embd this logic in a custom upload solution.
Not sure if this will circumvent the property promotion though.
Paul | SLIM Applications