How to delete the main file linked to document (type Picture) via REST API and its thumbnails?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 07:33 AM
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
1 REPLY 1

Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 10:53 AM
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.
