> 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="broken://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%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> を開き、 **編集**をクリックします。ダイアログで新しいファイル名を入力します。

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

ファイルを削除するには、そのファイルの **アクションメニュー** <picture><source srcset="broken://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%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> を開き、 **削除**をクリックします。ダイアログでファイルを削除してよいことを確認すると、ファイルが削除されます。

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

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

新しい版に更新するだけでよいファイルがある場合は、置き換えることができます。これにより、古いファイルが新しいファイルに差し替わります。以前に古いファイルを参照していたブロックは、すべて新しいファイルを参照するようになります。

ファイルを置き換えるには、そのファイルの **アクションメニュー** <picture><source srcset="broken://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%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" 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.
