Nuxeo server upload multiple files to a document

351 views Asked by At

Using below endpoint I can create document with single file in nuxeo server : http://localhost:8080/nuxeo/api/v1/path/domain/workspace. But I can not create document with multiple files. How I can do it?

1

There are 1 answers

3
Dipesh KC On
http://localhost:8080/nuxeo/api/v1/upload/

gives you <myBatchId>

Posting first image on that batch

http://localhost:8080/nuxeo/api/v1/upload/<myBatchId>/0

Posting second image on that batch

http://localhost:8080/nuxeo/api/v1/upload/<myBatchId>/1

Posting third image on that batch

http://localhost:8080/nuxeo/api/v1/upload/<myBatchId>/2

Finally

http://localhost:8080/nuxeo/api/v1/path/domain/workspace

{
  "entity-type": "document",
  "name":"myNewDoc",
  "type": "File",
  "properties" : {
    "dc:title":"My new doc",
    "file:content": {
      "upload-batch":"<myBatchId>",
      "upload-fileId":"0"
    },
    "files:files":[
        { "file" :  {
           "upload-batch":"<myBatchId>",
           "upload-fileId":"1"
        }},
        { "file" :  {
           "upload-batch":"<myBatchId>",
           "upload-fileId":"2"
        }},
     ]
   }
}