> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/tech/platform-development/onlyoffice-online-editing.md).

# 檔案庫 Office 線上編輯（ONLYOFFICE Docs 整合）

檔案庫 Office 線上編輯（ONLYOFFICE Docs）的網路連線方向與使用條件，供客戶網管規劃防火牆與網域白名單。目前僅 SaaS 提供。

檔案庫的 Office 檔案（`.docx`、`.xlsx`、`.pptx`）可以在瀏覽器內線上編輯。編輯器由 MaiAgent 營運的 ONLYOFFICE Document Server（以下稱「文件伺服器」）提供，使用者關閉編輯器後，編輯結果會存回檔案庫成為新版本。

本頁寫給客戶端的網管與資安人員：使用者的瀏覽器需要連到哪裡、文件在各元件之間怎麼流動，以及使用條件。編輯操作見使用者手冊的 [檔案庫：線上編輯](https://docs.maiagent.ai/work/file-library#online-editing)。目前僅 SaaS 提供此功能，地端版本請見[文末說明](#on-premise-deployment)。

## 服務元件 <a href="#components" id="components"></a>

| 元件                                | 角色                                    |
| --------------------------------- | ------------------------------------- |
| 文件伺服器（ONLYOFFICE Document Server） | 在瀏覽器中提供編輯器與多人協作；編輯結束後通知 MaiAgent 取回成品 |
| MaiAgent 平台                       | 簽發編輯工作階段、接收存檔通知，並把編輯結果寫成檔案的新版本        |
| 物件儲存                              | 存放檔案庫的原始檔與各版本                         |

## 連線方向 <a href="#network-paths" id="network-paths"></a>

### 使用者端需要開放的連線 <a href="#client-network" id="client-network"></a>

| 來源 → 目的                       | 用途                  |
| ----------------------------- | ------------------- |
| 使用者瀏覽器 → MaiAgent 後台網域（HTTPS） | 開啟檔案庫、取得編輯工作階段      |
| 使用者瀏覽器 → 文件伺服器網域（HTTPS）       | 載入編輯器並在編輯期間與文件伺服器連線 |

編輯器是從文件伺服器自己的網域載入，不是 MaiAgent 後台網域。公司網路有網域白名單、代理伺服器或 SSL 檢查時，請把文件伺服器網域一併放行；網域請洽 MaiAgent 窗口。

### 平台內部的連線 <a href="#platform-network" id="platform-network"></a>

下列連線都發生在 MaiAgent 營運的環境內，客戶不需要設定，列出來供資安評估了解文件的流向：

| 來源 → 目的             | 用途                           |
| ------------------- | ---------------------------- |
| 文件伺服器 → 物件儲存        | 開啟文件時以短效下載網址讀取原始檔            |
| 文件伺服器 → MaiAgent 平台 | 編輯結束時通知存檔                    |
| MaiAgent 平台 → 文件伺服器 | 健康檢查、取回編輯後的檔案、在使用者關閉編輯器後要求存檔 |

平台與文件伺服器之間的編輯設定與存檔通知都以共用密鑰簽章驗證。

## 使用條件 <a href="#requirements" id="requirements"></a>

* 組織需要開通檔案庫與線上編輯；未開通時，檔案選單不會出現編輯入口。
* 成員需要該空間的編輯權限。
* 只支援 `.docx`、`.xlsx`、`.pptx`，單檔 10 MB 以內；舊格式（`.doc`、`.xls`、`.ppt`）不提供線上編輯。
* 編輯器內關閉下載與列印，檔案需從檔案庫下載，以維持存取控管。
* 編輯過程中的自動存檔不會產生版本；所有人關閉編輯器後，內容才會存回成為新版本。

## 服務無法使用時 <a href="#availability" id="availability"></a>

平台在提供編輯入口前，會檢查文件伺服器是否正常（檢查結果保留約 30 秒）。檢查失敗時，Office 編輯入口會停用，直接開啟編輯會提示服務暫時無法使用、請改用上傳新版本；文件伺服器恢復後，入口約 30 秒內會自動恢復。

## 替代方式 <a href="#fallback" id="fallback"></a>

編輯服務無法使用、或檔案超過大小上限時，可以在電腦上編輯後，用檔案庫的 <mark style="color:blue;">上傳新版本</mark> 回傳。這個方式不依賴文件伺服器。

存回失敗時，檔名旁會顯示 <mark style="color:blue;">儲存失敗，點此重試</mark>，相關成員也會收到站內公告；點擊即可重新存回。

## 地端版本 <a href="#on-premise-deployment" id="on-premise-deployment"></a>

{% hint style="info" %}
Office 線上編輯目前僅 SaaS 提供，地端版本納入時程請洽 MaiAgent 窗口。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/tech/platform-development/onlyoffice-online-editing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
