Delete Specific Attachment From Document

Hello Guys, I have Problem in Removing Specific Attachment From Document. When I try to delete attachment with index 3, it will always delete last attachment that is index 0.

I have tried using below code. DocumentService ds = session.getAdapter(DocumentService.class); org.nuxeo.ecm.automation.client.model.DocRef docRef = new org.nuxeo.ecm.automation.client.model.DocRef(DOCID); ds.removeBlob(docRef, “files/content[3]“);

Please any help would be appreciated.

0 votes

1 answers

288 views

ANSWER



Hi,

I think your problem is in xpath of attachment. Please, use xpath with the format files:files/file[a], with a=[0..n) n=total of attachments, to delete it.

Regards, VS

0 votes



Ok Thanks for the help.
12/18/2017