How to copy a file from one document to another?
You can use the CopyOperation.java automation operation.
To execute an operation with the JS client, please refer to https://doc.nuxeo.com/nxdoc/javascript-client/ . Something along those lines:
nuxeo.operation('Document.Copy') .input(src.uid) .params({'target': target.uid}) .execute() .then(function(newlyCreatedDoc) { // work with the copied doc }) .catch(function(error) { // something went wrong throw error; });
The context of the question is too vague. Are you asking programmatically, using Rest API, automation, in JSF UI, Web UI?
I use nuxeo-js-client for browser.