> 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/creating-content/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では、ファイルごとに最大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/creating-content/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.
