Fail to update a document content and generating a new version through Rest API
We are encountering a bug in the document content update service api generating a new version of the document.
The bug occurs when trying to update a document through curl or postman:
When trying to update the content of the document already present in a directory, through CURL or postman, using the Update Node Content webservice (localhost/api-explorer/?urls.primaryName=Core%20API#/ nodes/updateNodeContent), we encounter a bug for WORD, XLSX, PPT files.
We proceed to update using CURL :
curl -X PUT -u user : password "localhost/alfresco/api/-default-/public/alfresco/versions/1/nodes/e0e70652-bfe8-466b-89c7-edca40400639/content?majorVersion=false&comment=newVersion&name=yoda- 2.docx" -H "accept: application/json" -H "Content-Type: application/octet-stream" -F "filedata=@/C:/link/to/path/yoda.docx"
After launching the curl command, the content of the file is modified and the version is also incremented but the document is no longer readable and at the level of the share interface, when we try to view the document we see the error "unreadable pdf format" and when we download the original version of the file we see a popup saying that the file has been corrupted.
NB: the update of a PDF type document is done automatically without failure and a new version is generated successfully. And the bug is only encountered when updating by CURL or postman, but no error when going through the share interface directly.
Screen 1 : Opening in share an EXCEL file after update
Screen 2 : Downloading and opening an EXCEL file after updating