Import API and Upload API Settings
Required Scripts
To use the Import feature, you must include the required scripts.
Use the editor.import.api, editor.upload.image.api, editor.upload.video.api, and editor.upload.file.api keys to configure the upload and import APIs.
The server-side API (URL) must be changed according to the back-end implementation. For details, refer to the Server Integration manual.
Configuration
| Key | Description |
|---|---|
editor.import.maxSize | Sets the maximum import file size. (unit: byte, default: 10 MB) This size is set by the browser (client); the importable file size may vary depending on server settings. |
editor.import.api | Sets the import API (URL). Document files are sent to this API (URL). |
editor.import.param | Sets the parameters to be sent together with the import request. |
editor.import.headers | Release 2.7.0 and above. Sets the import request headers. |
editor.import.requestOptions | Release 3.2.2507 and above. Sets the request options to use for the import request. See Request Options below. |
editor.upload.maxSize | Sets the maximum upload file size. (unit: byte, default: 3 MB) This size is set by the browser (client); the uploadable file size may vary depending on server settings. |
editor.upload.image.api | Sets the image upload API (URL). Images are sent to this API (URL). |
editor.upload.image.param | Sets the parameters to be sent together with the image upload request. |
editor.upload.image.headers | Release 2.7.0 and above. Sets the image upload request headers. |
editor.upload.image.requestOptions | Release 3.2.2507 and above. Sets the request options to use for the image upload request. See Request Options below. |
editor.upload.video.api | Sets the video upload API (URL). Videos are sent to this API (URL). |
editor.upload.video.param | Sets the parameters to be sent together with the video upload request. |
editor.upload.video.headers | Release 2.7.0 and above. Sets the video upload request headers. |
editor.upload.video.requestOptions | Release 3.2.2507 and above. Sets the request options to use for the video upload request. See Request Options below. |
editor.upload.file.api | Sets the file upload API (URL). Files are sent to this API (URL). |
editor.upload.file.param | Sets the parameters to be sent together with the file upload request. |
editor.upload.file.headers | Release 2.7.0 and above. Sets the file upload request headers. |
editor.upload.file.requestOptions | Release 3.2.2507 and above. Sets the request options to use for the file upload request. See Request Options below. |
Request Options
Release 3.2.2507 and above.
The editor.import.requestOptions, editor.upload.image.requestOptions, editor.upload.video.requestOptions, and editor.upload.file.requestOptions keys accept the following options.
| key | type | Description |
|---|---|---|
credentials | boolean | Specifies whether to include authentication info (cookies, auth headers, etc.) when sending an AJAX request to another domain. |
timeout | number | Sets the response wait time for the request in milliseconds (ms). |
Configuration Example
// synapeditor.config.js
{
'editor.import.maxSize': 10485760,
'editor.import.api': '/importDoc.do',
'editor.import.param': {},
'editor.import.headers': {},
'editor.import.requestOptions': {credentials: true, timeout: 300},
'editor.upload.maxSize': 3145728,
'editor.upload.image.api': '/uploadImage.do',
'editor.upload.image.param': {},
'editor.upload.image.headers': {},
'editor.upload.image.requestOptions': {credentials: true, timeout: 300},
'editor.upload.video.api': '/uploadVideo.do',
'editor.upload.video.param': {},
'editor.upload.video.headers': {},
'editor.upload.video.requestOptions': {credentials: true, timeout: 300},
'editor.upload.file.api': '/uploadFile.do',
'editor.upload.file.param': {},
'editor.upload.file.headers': {},
'editor.upload.file.requestOptions': {credentials: true, timeout: 300}
}