> 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/work/file-library/create-and-import.md).

# 建立工作區與匯入檔案

在檔案庫建立檔案工作區、新增資料夾，上傳檔案或整個資料夾，在上傳面板查看進度與未上傳原因，以及刪除不再使用的工作區與資料夾。

檔案都放在**檔案工作區**裡。建立工作區後，可以一次上傳多個檔案，或把電腦裡的整個資料夾連同子資料夾一起上傳，也可以在工作區內再建資料夾分類。

## 使用情境 <a href="#use-case" id="use-case"></a>

行銷專員接手一個新品活動，相關檔案散在信箱附件、雲端硬碟和同事電腦裡。她在 <mark style="color:blue;">個人空間</mark> 建立「新品活動」工作區，先把同事整理好的素材資料夾直接拖進工作區，子資料夾的層級原樣保留；再從工具列選 <mark style="color:blue;">上傳檔案</mark>，一次選取規格書和一份 11 MB 的產品型錄 PDF。上傳在右下角的面板進行，她可以邊等邊整理其他資料夾；面板標出資料夾裡有一個 0 KB 的空白檔案沒有上傳，她再向同事要正確的檔案。之後要找資料或請 AI 整理時，都從這個工作區開始。

***

## 建立檔案工作區 <a href="#create-workspace" id="create-workspace"></a>

### 1. 選擇空間 <a href="#select-space" id="select-space"></a>

從左側選單點選 <mark style="color:blue;">檔案庫</mark>，在空間樹選擇要放的空間：個人用的資料選 <mark style="color:blue;">個人空間</mark>，要給全組織使用的選 <mark style="color:blue;">組織空間</mark>（需要組織空間編輯權限），跨部門使用的選對應的 [共用空間](https://docs.maiagent.ai/work/file-library/shared-spaces.md)。

### 2. 新增檔案工作區 <a href="#add-workspace" id="add-workspace"></a>

點選空間樹上方的 <mark style="color:blue;">新增檔案工作區</mark>，確認 <mark style="color:blue;">位置</mark>，輸入 <mark style="color:blue;">檔案工作區名稱</mark> 後按 <mark style="color:blue;">建立</mark>。新的工作區會立即出現在空間樹與清單中。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-47ece4307d57991c2755a97a3cdc3b1734a00bf6%2Ffile-library-create-workspace.png?alt=media" alt="新增檔案工作區對話框，位置為我的檔案，輸入檔案工作區名稱"><figcaption><p>對話框會顯示工作區建立的位置</p></figcaption></figure>

{% hint style="info" %}
空間的最上層只能建立工作區，不能直接上傳檔案。在空間根目錄時，上傳選單裡的 <mark style="color:blue;">上傳檔案</mark> 會停用，請先進入或建立工作區；<mark style="color:blue;">上傳資料夾</mark> 仍可使用，上傳的資料夾會直接建成一個檔案工作區。
{% endhint %}

### 3. 新增資料夾（選用） <a href="#add-folder" id="add-folder"></a>

進入工作區後，點選 <mark style="color:blue;">新增資料夾</mark> 可以再分類。資料夾從空間根目錄起算最多 10 層。

***

## 上傳檔案與資料夾 <a href="#import-files" id="import-files"></a>

檔案與資料夾都上傳到工作區（或工作區裡的資料夾）。選好檔案就會開始上傳，進度顯示在畫面右下角的上傳面板；上傳期間可以繼續瀏覽、整理檔案庫。

### 上傳的入口 <a href="#upload-entry" id="upload-entry"></a>

* **工具列**：進入工作區或資料夾後，點選工具列的上傳圖示，選擇 <mark style="color:blue;">上傳檔案</mark> 或 <mark style="color:blue;">上傳資料夾</mark>。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-5a61bfcd6765fcf7cc1673a54d5fd09871a81171%2Ffile-library-upload-menu.png?alt=media" alt="檔案庫工具列的上傳選單，列出上傳檔案與上傳資料夾"><figcaption><p>工具列的上傳鈕可以選擇上傳檔案或上傳資料夾</p></figcaption></figure>

* **資料夾右鍵選單**：在清單、縮圖或左側空間樹的資料夾上按右鍵，選單第一行顯示資料夾名稱，選擇 <mark style="color:blue;">上傳檔案</mark>、<mark style="color:blue;">上傳資料夾</mark> 或 <mark style="color:blue;">新增資料夾</mark>，就會放進這個資料夾，不必先點進去。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-0a6ccc76d2c8c3fa0a1e91add1fdfbf466eaa09c%2Ffile-library-folder-context-menu.png?alt=media" alt="在「報價」資料夾上按右鍵，選單第一行是資料夾名稱，下方列出上傳檔案、上傳資料夾、新增資料夾、重新命名與刪除"><figcaption><p>右鍵選單的上傳與新增資料夾，會以這個資料夾為目標</p></figcaption></figure>

* **拖放**：從電腦把檔案或資料夾直接拖進檔案清單，放開前畫面會提示要上傳到哪裡。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-d35e3ff799d063842bbae5b5878cf36b5ae687de%2Ffile-library-upload-drop.png?alt=media" alt="把資料夾拖進檔案清單時，清單外框變成虛線，下方提示放開即可上傳到「示範上傳教學（虛構）」"><figcaption><p>拖放時會提示放開後要上傳到哪個位置</p></figcaption></figure>

{% hint style="info" %}
停用的選項會在滑鼠移上去時說明原因，例如空間根目錄不能直接上傳檔案。由外部來源同步的資料夾是唯讀的，右鍵選單會顯示鎖頭，上傳檔案、上傳資料夾與新增資料夾都會停用。
{% endhint %}

### 上傳檔案 <a href="#upload-files" id="upload-files"></a>

選擇 <mark style="color:blue;">上傳檔案</mark> 會開啟電腦的檔案選擇視窗，可以一次選取多個檔案。選好就開始上傳，不需要再按確認；檔案會逐一列在上傳面板，最多同時上傳 3 個檔案。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-3d052e32ce61ed9c67460f0bdb8663b736db1a83%2Ffile-library-upload-queue.png?alt=media" alt="上傳面板標題為正在上傳 1 個項目，一個 PDF 上傳中並顯示進度條，空白筆記.txt 與編輯手冊.epub 標示未上傳及原因"><figcaption><p>上傳面板逐檔顯示進度；沒有上傳的檔案會寫出原因</p></figcaption></figure>

面板上每個檔案的狀態：

| 狀態       | 說明                                                                                                                                  |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| 等待上傳     | 排隊中，前面的檔案傳完就會開始                                                                                                                     |
| 上傳中      | 正在上傳，下方顯示進度條                                                                                                                        |
| 已暫停・等待網路 | 網路中斷，恢復連線後會自動繼續                                                                                                                     |
| 已暫停      | 你按了暫停，按 <mark style="color:blue;">繼續</mark> 才會接著傳                                                                                   |
| 已上傳      | 上傳完成，滑鼠移上去可以按 <mark style="color:blue;">顯示檔案位置</mark>                                                                               |
| 未上傳      | 檔案沒有送出或被拒收，下方寫出原因                                                                                                                   |
| 上傳失敗     | 有檔案沒有傳上去，面板上方會顯示「N 個檔案上傳失敗」。若是傳送途中斷線、自動重送幾次仍失敗，可以按 <mark style="color:blue;">重試</mark> 重送；若是檔案本身不符規定（例如空白或不支援的格式），沒有重試按鈕，請修正檔案後重新上傳 |
| 已取消      | 你取消了這個檔案的上傳                                                                                                                         |

### 上傳整個資料夾 <a href="#upload-folder" id="upload-folder"></a>

選擇 <mark style="color:blue;">上傳資料夾</mark> 後選取電腦裡的一個資料夾，或直接把資料夾拖進檔案清單。資料夾會連同子資料夾的層級一起建立，在上傳面板裡佔一列，顯示「已上傳 / 總數 個檔案」；有檔案沒上傳時，點開「N 個檔案未上傳」可以看每個檔案的路徑與原因。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-ec5a1f055b15a8227a43b8fcdec5922d968700b5%2Ffile-library-upload-folder-result.png?alt=media" alt="上傳面板中的示範專案資料資料夾，顯示 3 / 5 個檔案，展開後列出 2 個檔案未上傳：編輯手冊.epub 不支援的格式、空白筆記.txt 檔案是空的"><figcaption><p>資料夾佔一列，展開可以看到哪些檔案沒上傳及原因</p></figcaption></figure>

上傳資料夾時：

* 隱藏檔與隱藏資料夾（例如 `.git`、`.DS_Store`），以及系統產生的 `Thumbs.db`、`desktop.ini` 會直接略過，不列為未上傳。
* 不支援的格式、超過大小上限或空白（0 KB）的檔案不會送出，列在這一列的未上傳清單，這一列會標示「上傳失敗」，但其他檔案照常上傳完成；如果某個子資料夾裡只有這類檔案，這個子資料夾不會建立。
* 目標位置已經有同名的資料夾時，整個資料夾都不會上傳，畫面會提示「底下已經有同名的資料夾」。請先改名再上傳。

{% hint style="info" %}
**空資料夾只有用拖放才會建立。** 用 <mark style="color:blue;">上傳資料夾</mark> 選取時，瀏覽器只提供檔案清單，裡面沒有檔案的資料夾不會出現在檔案庫；要保留空資料夾，請直接把資料夾從電腦拖進檔案清單。只放了 `.DS_Store` 這類隱藏檔的資料夾不算空資料夾，也不會建立。
{% endhint %}

### 上傳期間的操作 <a href="#during-upload" id="during-upload"></a>

* **暫停、取消**：上傳中的項目可以按 <mark style="color:blue;">暫停</mark>，之後按 <mark style="color:blue;">繼續</mark>；不想傳了按 <mark style="color:blue;">取消上傳</mark>。未上傳或上傳失敗的項目可以按 <mark style="color:blue;">移除</mark> 從面板清掉。
* **網路中斷**：上傳會暫停，面板顯示「網路連線中斷，恢復後會自動繼續」；恢復連線後從中斷的地方接著傳，不必重新選檔案。沒收到回應的檔案會自動重送幾次，仍失敗才標示「上傳失敗」。
* **關閉面板**：還有正在上傳或等待中的項目時，會先詢問「取消上傳？」；都傳完了就直接收起。
* **離開檔案庫**：還有正在上傳或等待中的項目時，切換到其他頁面或切換組織，會先跳出「離開檔案庫？」。按 <mark style="color:blue;">繼續上傳</mark> 留在原頁、上傳照常進行；按 <mark style="color:blue;">離開並取消上傳</mark> 會取消尚未完成的項目再離開。關閉分頁或重新整理時，瀏覽器也會先跳出確認。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-41dcf00fcfbcecead9a92d75c9732532b61d3250%2Ffile-library-upload-leave-confirm.png?alt=media" alt="離開檔案庫？確認框，說明正在上傳和等待中的項目會取消，按鈕為繼續上傳與離開並取消上傳"><figcaption><p>還有檔案在上傳時離開檔案庫，會先請你確認</p></figcaption></figure>

### 支援的格式與大小 <a href="#supported-formats" id="supported-formats"></a>

| 類型    | 格式                                                  |
| ----- | --------------------------------------------------- |
| 文件    | PDF、DOC、DOCX、PPT、PPTX、XLS、XLSX、CSV、TXT、MD、JSON、HTML |
| 圖片    | PNG、JPG、JPEG、GIF、WebP                               |
| 音訊與影片 | MP3、WAV、M4A、MP4                                     |

上傳檔案與上傳資料夾的單檔上限為 **500 MB**，空白（0 KB）的檔案不能上傳。檔案詳情裡的 <mark style="color:blue;">上傳新版本</mark> 仍是單檔 10 MB，詳見 [線上編輯](https://docs.maiagent.ai/work/file-library/online-editing.md)。

檔案沒有上傳時，上傳面板會寫出原因：

| 原因            | 處理方式             |
| ------------- | ---------------- |
| 檔案是空的（0 KB）   | 確認檔案內容後重新上傳      |
| 不支援的格式（.副檔名）  | 轉成上表支援的格式        |
| 超過單檔上限 500 MB | 壓縮或拆分檔案          |
| 這個資料夾已有同名的檔案  | 先改名，或刪除資料夾裡的舊檔   |
| 儲存空間不足        | 刪除不需要的檔案，或洽組織管理者 |

***

## 刪除工作區或資料夾 <a href="#delete-workspace-or-folder" id="delete-workspace-or-folder"></a>

在工作區卡片或資料夾上按右鍵（或點選 <mark style="color:blue;">⋯</mark>），選擇 <mark style="color:blue;">刪除</mark>。

{% hint style="warning" %}
只能刪除**已清空**的工作區或資料夾：請先刪除或移走裡面的檔案。刪除工作區時，底下的空資料夾、工作區指引與版本紀錄會一併移除。空間根目錄與 <mark style="color:blue;">暫存區</mark> 等系統資料夾不能刪除。
{% endhint %}

***

## 相關頁面 <a href="#related" id="related"></a>

* [搜尋、篩選與檔案詳情](https://docs.maiagent.ai/work/file-library/search-and-details.md)
* [在 MaiGPT 使用工作區](https://docs.maiagent.ai/work/file-library/use-in-maigpt.md)
* [版本紀錄與還原](https://docs.maiagent.ai/work/file-library/versions.md)


---

# 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/work/file-library/create-and-import.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.
