> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/blocks/insert-files.md).

# ファイル

ファイルをGitBookのセクションにアップロードし、ページに追加して、閲覧またはダウンロードできるようにすることができます。

画像やOpenAPIファイルなど、一部のファイルは、クリックしなくてもページ上でそのまま表示して閲覧できます。PDFなどのほかのファイルは、表示またはダウンロードするにはクリックする必要があります。

必要に応じて、ページに挿入した任意のファイルの下にキャプションを追加して、さらに情報を加えることもできます。

### ファイルの例 <a href="#example-of-a-file" id="example-of-a-file"></a>

{% file src="/files/e500a7aceefad0dd77e8d5ca7887aeb4aa0d0a30" %}
これはファイルのキャプションです。
{% endfile %}

### ファイルをアップロードする

アップロードしたファイルは、 **ライブラリ** タブで管理できます。 **ライブラリ** タブは **ページ** の左側ナビゲーション上部にあります。

ファイルをアップロードするには、 **ファイルをドロップするか、参照してください** セクションにドラッグ＆ドロップするか、選択してシステムのファイルダイアログを使い、アップロードしたいファイルを選択します。

{% hint style="warning" %}
GitBookでは、1ファイルあたり最大100MBまでアップロードできます。
{% endhint %}

画像ブロックまたはOpenAPIブロックを追加するときにも、ページにファイルを追加できます。これらのブロックのいずれかを作成すると、 **ライブラリ** タブが開くので、ファイルを選択するか、新しいファイルをアップロードできます。

{% hint style="info" %}
**ヒント：** ファイルシステムから画像をエディタへ直接ドラッグ＆ドロップすることも、コピーした画像をコンテンツに貼り付けることもできます。GitBookはそれらを自動的にそれぞれのセクションの **ライブラリ** タブに追加するので、後で表示・管理できます。
{% endhint %}

### ファイル名を変更する

ファイル名を変更するには、ファイルの **アクションメニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> を開き、 **編集**をクリックします。ダイアログのプロンプトで、ファイルの新しい名前を入力してください。

### ファイルを削除する

ファイルを削除するには、ファイルの **アクションメニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> を開いて **削除**をクリックします。ファイルを削除してよいことをダイアログで確認すると、ファイルは削除されます。

{% hint style="warning" %}
**注：** 削除したファイルを含むページは必ず更新してください！ 削除されたファイルを参照しているファイルブロックは、空のブロックとして表示されるか、 *画像を読み込めませんでした* エラー。
{% endhint %}

### ファイルを置き換える

新しいバージョンに更新するだけでよいファイルがある場合は、置き換えることができます。これにより、古いファイルが差し替えられ、新しいファイルがその場所に入ります。以前に古いファイルを参照していたブロックは、その後は新しいファイルを参照するようになります。

ファイルを置き換えるには、 **アクションメニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> を開いて **置き換える**を開きます。表示されるファイル置換ダイアログで新しいファイルを選び、アップロードの進行表示が完了するまで待ちます。ファイルは、セクション内の表示箇所すべてで自動的に更新されます。

たとえば、大規模な製品デザイン変更があり、複数のページに表示されている古いUIスクリーンショットを更新する必要がある場合に便利です。元のファイルを置き換えることで、セクション内のどこでもスクリーンショットが更新され、時間と手間を節約できます。

{% hint style="info" %}
**ヒント：** 画像やファイルをアップロードしたら、画像ブロックまたはファイルブロックを作成して **ライブラリ** タブから選択することで、セクション内のどこでも参照できます。

そのたびに画像を再アップロードするよりも、こちらをおすすめします。後で画像を置き換えやすくなり、同じ名前のファイルが複数できるのを防げます。
{% endhint %}

### Markdown での表記

```markdown
{% file src="https://example.com/example.pdf" %}
    これはサンプルファイルのキャプションです。
{% endfile %}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/blocks/insert-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
