Skip to main content

Upload Image API (Optional)

Version Requirement

This API is supported starting from v9, currently used for uploading images during Markdown document editing.

MethodAPIDescription
POST/{context}/{docId}/file/imageUpload image to business system

Description:
When a user inserts an image in the Markdown editor, zOffice Server sends the image file to the business system via this API. The business system must store the image and return an accessible image URL for the deployment environment, which will be written into the Markdown content (e.g., ![](url) format).

Request​

ParameterRequiredLocationDescriptionTypeDefault
docIdYesPathThe ID of the document being editedstring
Content-TypeYesHeaderMust be multipart/form-datastring
fileYesBody (form data)The image file itself. MIME type must start with image/ (e.g. image/png, image/jpeg)multipartfile

Request Example:

POST http://172.16.52.223/v2/context/484/file/image
Content-Type: multipart/form-data

------boundary
Content-Disposition: form-data; name="file"; filename="screenshot.png"
Content-Type: image/png

<image binary data>
------boundary--

Response​

Success Response (200):

The business system must return a JSON containing the accessible image URL.

{
"url": "https://your-domain.com/images/screenshot.png"
}

Image Deletion Policy​

When a user deletes an image reference (![](url)) in the Markdown editor, zOffice Server will NOT send a delete request to the business system. Only the corresponding Markdown image syntax is removed from the document content. The lifecycle of the image file is managed by the business system.

Limitations​

Integration Mode Limitation

This API currently supports standard and frontend integration modes.
The frontend SDK integration mode is not supported and will return HTTP 501.

Configuration​

Before integration, enable the MD image upload feature in the zOffice Server Admin Console:

  1. Navigate to Admin Console → Third-party App Configuration
  2. Edit the target third-party app and check "Enable MD Image Upload"
  3. Save the configuration

This option is disabled by default. When not enabled, image upload requests from the frontend will return HTTP 403.