As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
How to delete the main file linked to document (type Picture) via REST API and its thumbnail?
I want to delete it because I have to change it by onother one through PUT update of content:file
Hi Antonio,
You can try the following solution on API playground:
POST <Nuxeo URL>/nuxeo/site/automation/Document.RemoveProperty
with raw-body:
{ "input": "<documentId>", "params": { "xpath": "files/content" } }
Alternatively, you can run the following code using Node.js and Nuxeo JS Client:
#!/usr/bin/env node const Nuxeo = require('nuxeo'); const nuxeo = new Nuxeo({ auth: { method: 'basic', username: 'Administrator', password: 'Administrator' } }); nuxeo.operation('Blob.Remove') .input('/default-domain/path/to/my/picture') .execute() .then(function(res) { }) .catch(function(error) { throw new Error(error); });
I tested these two solutions on a Picture document and both worked for me. I hope that helps.