> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ja/narejjibsu/081-how-to-upload-a-file-using-an-external-url.md).

# 外部URLを使ってファイルをアップロードする方法

## はじめに

この記事では、外部でホストされているファイルを Overleaf プロジェクトにアップロードする方法を、 **外部URLから** 機能について説明します。まず、ファイル共有リンクと直接ダウンロードリンクを説明するための簡単な導入から始めます。

## ファイル共有リンク（URL）

Google Drive、Dropbox、OneDrive などのファイルホスティングサービスでは、ファイルを安全に共有できます。つまり、ファイル共有リンク（URL）を作成して提供し、特定のファイルにアクセスできる人を制限し、許可されるアクセスモード（閲覧のみか、編集可能か）を決定します。ファイル共有リンクを受け取り、それを選択またはクリックした人は、ファイルにアクセスする前にホスティングサービスにログイン（認証）する必要がある場合があります。または、ファイルのプレビューを表示し、そこから手動でダウンロードするための追加リンクがある「ランディングページ」に移動することもあります。

## 直接ダウンロードリンク（URL）

ファイルリンク（URL）の重要な種類の1つは、 [直接ダウンロードリンク](https://en.wikipedia.org/wiki/Direct_download_link) これにより、認証（ログイン）を行ったり、中間のランディングページやその他のインターフェースを使ったりすることなく、ファイルをすぐにダウンロードできます。直接ダウンロードリンクをクリック／選択すると、ダウンロード処理が開始されます。

Overleaf の **外部URLから** 機能を使うには、Google Drive、Dropbox、OneDrive などのファイルホスティングサービスが提供するファイル共有 URL（リンク）を **変換** して、直接ダウンロードリンク（別の URL）にする必要があります。変換方法は、ホスティングサイト／クラウドサービスによって異なります。たとえば、以下は [Dropbox のリンク共有 URL から直接ダウンロードリンクを作成する](https://help.dropbox.com/files-folders/share/force-download) （この記事執筆時点で有効だったものです）。

## Overleaf の「外部URLから」機能

特定のファイルの直接ダウンロードリンクがあれば、Overleaf の **外部URLから** 機能を使って、そのファイルをプロジェクトにアップロードできます。

まず、ファイルアップロードアイコンを選択し、次に **外部URLから**:

![Overleaf の「外部URLから」機能](/files/aaf0d67ae41bbe4f3be652e19ef1a14a1369ae5e)

リンクを入力し、ファイルに名前を付けます：

* **ファイルを取得する URL**：Google Drive などのファイルホスティングサービスの直接ダウンロードリンク（URL）を入力します
* **このプロジェクトでのファイル名**：アップロードするプロジェクトファイルに名前を付けます。スペース文字は含めないでください

### Google Drive の例

次の動画では、Google Drive の直接ダウンロードリンクを使ってプロジェクトファイルをアップロードする方法と、元のファイルが Google Drive で更新または変更された場合にプロジェクトファイルを更新する方法を示します。

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/2PMXTshGJI0Kg2ZtN6iXtk/18d4a3168847009a39f905c9acc45e51/Google_drive_upload.mp4>" %}

## リンク共有 URL を直接ダウンロード URL に変換する際の注意

読者の皆さまには、以下の点にご注意ください：

* ファイルホスティングサービスは、リンク共有 URL の構造を変更することがあります。たとえば [Google Drive のセキュリティ更新](https://support.google.com/a/answer/10685032?hl=en)。こうした変更があるため、Overleaf が URL 変換の手順を完全に文書化して提供するのは現実的ではありません。公開後すぐに案内が古くなる可能性があるためです。読者は、利用しているホスティングサービスが提供する最新のドキュメントを探して参照するか、最新の記事や YouTube 動画を探してください。
* 組織／雇用主は、組織のファイルやリソースを共有するために使われる URL から直接ダウンロードリンクが作成されないようにするセキュリティポリシー／手順を実装できます。外部ファイルを Overleaf にアップロードする際に問題が発生した場合は、ファイル共有サービスの組織内管理者／担当者に問い合わせてください。
* ファイル共有サービスにログインしていない状態で動作することを確認するために、作成したダウンロードリンクをシークレット／プライベートブラウザページで確認するとよいでしょう。


---

# 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://overleaf-pro.ayaka.space/latex/ja/narejjibsu/081-how-to-upload-a-file-using-an-external-url.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.
