Nuxeo Uploader Javascript
Upload easily a file to nuxeo.
Install
npm install --save nuxeo-uploader
Usage
const nuxeoUploader = require('nuxeo-uploader');
var nuxeoUp = nuxeoUploader('myUrl', 'myToken');
nuxeoUp({
id_parent: '',
id_file: '',
document: {
name: '',
title: '',
description: '',
},
file: 'myUrl',
attach: ['myUrl', 'myUrl'],
}).then((data) => {
}).catch((error) => {
})
var nuxeoUp = nuxeoUploader('myUrl', {
auth: {
user: 'myUser',
pwd: 'myPwd',
},
});
nuxeoUp({
id_parent: '',
id_file: '',
document: {
name: '',
title: '',
description: '',
},
file: {
id: '1',
url: 'myUrl',
},
attach: ['myUrl'],
}).then((data) => {
}).catch((error) => {
})
var nuxeoUp = nuxeoUploader('myUrl', {
token: 'myToken',
});
nuxeoUp({
id_parent: '',
id_file: '',
document: {
name: '',
title: '',
description: '',
},
file: 'myUrl',
attach: [
{
id: '1',
url: 'myUrl',
},
{
id: '0',
url: 'myUrl',
},
],
}).then((data) => {
}).catch((error) => {
})
Works
To upload a file in nuxeo you have to fill file
property but if you want to attach files in a entity you have to fill 'attach' property.