Page Properties |
---|
|
Product Version |
|
---|
Report Note |
|
---|
Assignee |
|
---|
Resources & Remarks Modification History Name | Date | Product Version | Action |
---|
Antje | 08 FEB 2021 | 2.4 | New page properties macro. |
|
...
Check out our graphical overview of the architecture which describes the basic use case flow for importing documents.
Section |
---|
|
Column |
---|
Table of Contents Table of Contents |
---|
exclude | (Table of Contents|More Tutorials|Updating Documents|Retrieving Documents|Deleting Documents) |
---|
|
|
|
...
...
Code Block |
---|
language | js |
---|
title | Creating Multipart Form Data using FormData API |
---|
|
var singleFormData = new FormData()
var metadataBlob = new Blob([JSON.stringify(singleMetadata)],{type:"application/json"})
var contentBlob = new Blob([file],{type:"text/plain"})
singleFormData.append('data', metadataBlob, "metadata")
singleFormData.append('cid_63apple', contentBlob, "contentdata") |
Assembling the Request
Now that we have created JSON representations for our content and metadata, we can assemble our multipart HTTP request object. We are going to go over some simple methods to accomplish this and give examples for both browser-based front-end and node.js-based back-end applications.
...
Code Block |
---|
language | js |
---|
title | Batch Import Form Data |
---|
|
var multiFormData = new FormData()
var metadataBlob = new Blob([JSON.stringify(singleMetadata)],{type:"application/json"})
var contentBlob1 = new Blob([file],{type:"text/plain"})
var contentBlob2 = new Blob([file2],{type:"text/plain"})
multiFormData.append('data', metadataBlob, "metadata")
multiFormData.append('cid_63apple', contentBlob1, "contentdata1")
multiFormData.append('cid_64apple', contentBlob2, "contentdata2") |
Assembling the Request
The multipart request JSON assembly is similar to the singular import. The same function executeRequest(request_object)
can be used to send the request.
...