> 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).

# ファイル

PDF、動画、文書など、サイトにファイルを管理・追加します

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="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> そのファイルの **編集**。表示されたダイアログで、ファイルの新しい名前を入力してください。

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

ファイルを削除するには、 **操作メニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> そのファイルの **削除**を開き、クリックします。ダイアログでファイルを削除してよいことを確認すると、ファイルは削除されます。

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

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

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

ファイルを置き換えるには、 **アクションメニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" 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 by asking a question.

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

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/blocks/insert-files.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.
