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
<table> <thead> <tr><th>Key</th><th>Description</th></tr> </thead> <tbody> <tr> <td><code>editor.import.maxSize</code></td> <td>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.
</td> </tr> <tr> <td><code>editor.import.api</code></td> <td>Sets the import API (URL). Document files are sent to this API (URL).</td> </tr> <tr> <td><code>editor.import.param</code></td> <td>Sets the parameters to be sent together with the import request.</td> </tr> <tr> <td><code>editor.import.headers</code></td> <td>Release 2.7.0 and above. Sets the import request headers.
</td> </tr> <tr> <td><code>editor.import.requestOptions</code></td> <td>Release 3.2.2507 and above. Sets the request options to use for the import request.
| 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). |
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.
</td> </tr> <tr> <td><code>editor.upload.image.api</code></td> <td>Sets the image upload API (URL). Images are sent to this API (URL).</td> </tr> <tr> <td><code>editor.upload.image.param</code></td> <td>Sets the parameters to be sent together with the image upload request.</td> </tr> <tr> <td><code>editor.upload.image.headers</code></td> <td>Release 2.7.0 and above. Sets the image upload request headers.
</td> </tr> <tr> <td><code>editor.upload.image.requestOptions</code></td> <td>Release 3.2.2507 and above. Sets the request options to use for the image upload request.
| 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). |
Release 2.7.0 and above. Sets the video upload request headers.
</td> </tr> <tr> <td><code>editor.upload.video.requestOptions</code></td> <td>Release 3.2.2507 and above. Sets the request options to use for the video upload request.
| 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). |
Release 2.7.0 and above. Sets the file upload request headers.
</td> </tr> <tr> <td><code>editor.upload.file.requestOptions</code></td> <td>Release 3.2.2507 and above. Sets the request options to use for the file upload request.
| 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}
}