Import API and Upload API Settings

Required Scripts

To use the Import feature, you must include the required scripts.

  • Import extension feature: Link
  • Shape editor feature: Link
  • Excel function feature: Link

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.

keytypeDescription
credentialsbooleanSpecifies whether to include authentication info (cookies, auth headers, etc.) when sending an AJAX request to another domain.
timeoutnumberSets the response wait time for the request in milliseconds (ms).
</td> </tr> <tr> <td><code>editor.upload.maxSize</code></td> <td>

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.

keytypeDescription
credentialsbooleanSpecifies whether to include authentication info (cookies, auth headers, etc.) when sending an AJAX request to another domain.
timeoutnumberSets the response wait time for the request in milliseconds (ms).
</td> </tr> <tr> <td><code>editor.upload.video.api</code></td> <td>Sets the video upload API (URL). Videos are sent to this API (URL).</td> </tr> <tr> <td><code>editor.upload.video.param</code></td> <td>Sets the parameters to be sent together with the video upload request.</td> </tr> <tr> <td><code>editor.upload.video.headers</code></td> <td>

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.

keytypeDescription
credentialsbooleanSpecifies whether to include authentication info (cookies, auth headers, etc.) when sending an AJAX request to another domain.
timeoutnumberSets the response wait time for the request in milliseconds (ms).
</td> </tr> <tr> <td><code>editor.upload.file.api</code></td> <td>Sets the file upload API (URL). Files are sent to this API (URL).</td> </tr> <tr> <td><code>editor.upload.file.param</code></td> <td>Sets the parameters to be sent together with the file upload request.</td> </tr> <tr> <td><code>editor.upload.file.headers</code></td> <td>

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.

keytypeDescription
credentialsbooleanSpecifies whether to include authentication info (cookies, auth headers, etc.) when sending an AJAX request to another domain.
timeoutnumberSets the response wait time for the request in milliseconds (ms).
</td> </tr> </tbody> </table>

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}
}

Related Features