[1] [DFN[[[FTP]]]] ([DFN[[[File Transfer Protocol]]]]) は、[[インターネット]]で[[ファイル]]を転送するための[[アプリケーション層プロトコル]]です。

* 仕様書

[REFS[
- [39] '''[CITE@en[RFC 959 - File Transfer Protocol]] ([TIME[2016-06-05 16:18:06 +09:00]]) <https://tools.ietf.org/html/rfc959>'''
- [40] [CITE[RFC Errata Report » RFC Editor]] ([TIME[2016-06-11 11:45:45 +09:00]]) <https://www.rfc-editor.org/errata_search.php?rfc=959>
- [41] [CITE@en[RFC 2228 - FTP Security Extensions]] ([TIME[2016-06-05 16:39:55 +09:00]]) <https://tools.ietf.org/html/rfc2228>
- [51] [CITE@en[RFC 2428 - FTP Extensions for IPv6 and NATs]] ([TIME[2016-06-05 16:23:08 +09:00]]) <https://tools.ietf.org/html/rfc2428>
- [42] [CITE@en[RFC 2640 - Internationalization of the File Transfer Protocol]] ([TIME[2016-06-05 16:21:46 +09:00]]) <https://tools.ietf.org/html/rfc2640>
- [44] [CITE@en[RFC 3659 - Extensions to FTP]] ([TIME[2016-06-05 16:21:51 +09:00]]) <https://tools.ietf.org/html/rfc3659>
- [47] [CITE[RFC Errata Report » RFC Editor]] ([TIME[2016-06-11 11:49:21 +09:00]]) <https://www.rfc-editor.org/errata_search.php?rfc=3659>
- [45] [CITE@en[RFC 5797 - FTP Command and Extension Registry]] ([TIME[2016-06-05 16:19:05 +09:00]]) <https://tools.ietf.org/html/rfc5797>
- [46] [CITE[RFC Errata Report » RFC Editor]] ([TIME[2016-06-11 11:49:08 +09:00]]) <https://www.rfc-editor.org/errata_search.php?rfc=5797>
]REFS]

* FTP に関する概念

[FIG(short list)[
- [[匿名FTP]]
- [[ASCIIモード]]
- [[バイナリーモード]]
- [[PASVモード]]
- [[パーミッション]]
- [[FTPメール]]
- [[FTPの日時形式]]
- [[ange-ftp addresses]]

]FIG]


* ポート

[9] [[既定のポート番号]]は [CODE[[[21]]]] です。

[33] [[port blocking]] も参照。

* URL scheme

[2] [[URL scheme]] としては [CODE(URI)@en[[[ftp:]]]] が使われています。

;; [CODE(URI)@en[[[ftp:]]]] を参照。

* クライアント

[3] [[Unix]] 系を含め多くの近代的な [[OS]] には標準で [[FTP]]
クライアントが付属しています。

[4] [[Webブラウザー]]にも [[FTP]] による[[ファイル]]の受信機能が組み込まれているのが普通です。
[[FTP]] 受信機能を有さない [[Webブラウザー]]は [[Web互換]]ではありません。

;; [5] [[Web]] の初期には [[HTTP]] のかわりに [[FTP]] が使われることもありました。
現在では専ら[[ファイル]]の[[ダウンロード]]のために用いられていますが、
それも徐々に [[HTTP]] に置き換えられています。

;; [61] [[Firefox]] や [[Chrome]] でも削除が提案されたことがありますが、
少なからず使われており削除して良いとは断言できないとして、
現在も残されています。

[60] [[FTP]] は歴史も長く多機能な[[プロトコル]]ですが、 [[Webブラウザー]]が必要とするのは単純な[[ダウンロード]]のみで、
ごく基本的な部分に限られます。

;; [[WebブラウザーのFTPの動作]]および[[HTTP接続の処理]]参照。

* 串

[11] [[FTP]] では[[串]] ([[アプリケーション層]]スイッチ) が使われることがあります。

[12] [[FTP]] の[[串]]には、 [[FTP]] [[プロトコル]]で中継するものと、
[[SOCKS]] を下位層プロトコルとして使うもの、
[[HTTP]] で中継するものがあります。

[13] [[HTTP]] の場合は、[[クライアント]]と[[串]]の間は [[HTTP]] で通信し、
[[FTP]] そのものは使いません。
[SEE[ [[FTP over HTTP]] ]]

* Web サーバー管理プロトコルとしての FTP

[6] [[Web]] において [[HTTP]] によって配信される[[ファイル]]を[[サーバー]]上に配置するため転送
([[アップロード]]) する方法として、90年代には [[FTP]] は極めてよく用いられていました。

[7] その後 [[SCP]] に置き換えられたり、[[静的ファイル]]として配置する構成から 
[[Webアプリケーション]]の編集機能によって [[Webブラウザー]]上から変更する構成へと主流が移り変わったりと
[[FTP]] を使って[[アップロード]]することは徐々に減少してきていますが、
現在も使われていることがあります。

* 実例

[75] [[匿名FTP]]も参照。

* 関連

[8] [[TFTP]] や [[SFTP]] は [[FTP]] と直接関係ありません。

* 歴史

[43] [CITE@en[RFC 2773 - Encryption using KEA and SKIPJACK]] ([TIME[2016-06-05 16:23:59 +09:00]]) <https://tools.ietf.org/html/rfc2773>

[22] [CITE@en[draft-bryan-ftpext-hash-02 - File Transfer Protocol HASH Command for Cryptographic Hashes]]
( ([TIME[2014-10-17 01:13:27 +09:00]] 版))
<https://tools.ietf.org/html/draft-bryan-ftpext-hash-02>

[23] [CITE@ja[FTPメール - Wikipedia]]
( ([TIME[2014-12-05 23:18:04 +09:00]] 版))
<http://ja.wikipedia.org/wiki/FTP%E3%83%A1%E3%83%BC%E3%83%AB>

[10] [CITE@en[mod_proxy_ftp - Apache HTTP Server Version 2.4]]
([TIME[2015-01-02 00:30:56 +09:00]] 版)
<http://httpd.apache.org/docs/current/en/mod/mod_proxy_ftp.html>

[14] [[Google]] の検索結果に [CODE(URI)@en[[[ftp:]]]] [[URL]]
の [[Webページ]]が出てくることが稀にあります。 [TIME[2015-04-24T03:36:36.600Z]]

[15] [CITE@en[Chromium Blog: A New FTP Implementation Goes Live]]
([TIME[2015-08-27 02:22:34 +09:00]] 版)
<http://blog.chromium.org/2009/09/new-ftp-implementation-goes-live.html>

[16] [CITE[Issue 96401 - chromium - FTP file download problem - An open-source project to help move the web forward. - Google Project Hosting]]
([TIME[2015-08-28 18:09:12 +09:00]] 版)
<https://code.google.com/p/chromium/issues/detail?id=96401>

[FIG(quote)[
[FIGCAPTION[
[17] [CITE[Issue 333943 - chromium - Remove built-in support for FTP from Chrome - An open-source project to help move the web forward. - Google Project Hosting]]
([TIME[2015-08-28 18:12:34 +09:00]] 版)
<https://code.google.com/p/chromium/issues/detail?id=333943>
]FIGCAPTION]

> Over a 7-day period, only .1-.2% of users end up navigating to any FTP URL (with slightly higher numbers amongst Linux desktop users). This has been fairly stable over the last year, so it doesn't look there are trends for FTP to disappear altogether. 

]FIG]


[18] [CITE@en[1174462 – Remove built-in support for FTP]]
([TIME[2015-08-28 18:13:39 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=1174462>

[19] [CITE@en[85464 – Support FTP over TLS/SSL (FTPS)]]
([TIME[2015-08-28 18:25:22 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=85464>

[20] [CITE@en[207298 – FTP directory problems w/ URL parsing when URL root is not filesystem root]]
([TIME[2015-08-28 18:29:22 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=207298>

[24] [CITE@en[196286 – ftp URLs w/ "anonymous" user should automatically use anonymous password.]]
([TIME[2015-08-28 18:30:20 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=196286>

[25] [CITE@en[202419 – ftp://@hostname should tell FTP to use username and password auth]]
([TIME[2015-08-28 18:31:13 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=202419>

[26] [CITE@en[251892 – Non-US-ASCII chars in FTP file name are problematic]]
([TIME[2015-08-28 18:32:44 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=251892>

[27] [CITE@en[24867 – basic UI for FTP upload (menu) not implemented]]
([TIME[2015-08-28 18:33:36 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=24867>

[28] [CITE@en[297395 – ftp : cannot open a folder with Cyrillic letters in its name on an IIS server]]
([TIME[2015-08-28 18:34:35 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=297395>

[29] [CITE@en[117875 – close FTP control connections when no docshell actively displaying it]]
([TIME[2015-08-28 18:38:19 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=117875>

[30] [CITE@en[448141 – Unable to open file with special characters in file:// ftp:// listing (";", semicolon, in file name)]]
([TIME[2015-08-28 18:40:25 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=448141>

[31] [CITE@en[92582 – Some MS ftp servers (ftp.microsoft.com) never display lists - PASV invalid after error response]]
([TIME[2015-08-28 18:40:45 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=92582>

[32] [CITE@ja[JVNDB-2015-002155 - JVN iPedia - 脆弱性対策情報データベース]]
([TIME[2015-04-14 11:25:14 +09:00]] 版)
<http://jvndb.jvn.jp/ja/contents/2015/JVNDB-2015-002155.html>

[34] [CITE@en[RFC 4217 - Securing FTP with TLS]]
( ([TIME[2016-03-31 07:54:54 +09:00]]))
<https://tools.ietf.org/html/rfc4217>

[35] [CITE@ja[Internet Explorer 7、8からのFTP利用方法を教えてほしい。 | 会員サポート > Q&A(よくあるご質問) : @nifty]]
( ([TIME[2016-06-11 11:30:34 +09:00]]))
<http://qa.nifty.com/cs/catalog/faq_nqa/qid_11026/1.htm>

[36] [CITE@ja[Internet ExplorerでFTPを利用する]]
( ([TIME[2016-06-11 11:31:10 +09:00]]))
<http://www.losttechnology.jp/Tips/ieftp.html>

[FIG(quote)[
[FIGCAPTION[
[37] [CITE@ja-JP[FTP サイトにおけるファイル操作 - Windows ヘルプ]]
( ([TIME[2016-05-24 12:14:06 +09:00]]))
<http://windows.microsoft.com/ja-jp/windows/work-with-files-ftp-site#1TC=windows-7>
]FIGCAPTION]

> FTP サイトで、ファイルのアップロード、ファイルの削除、フォルダー構造の変更を行うには、Windows エクスプローラーでサイトを開く必要があります。単に FTP サイトを開いてそこからファイルをダウンロードする場合は、Internet Explorer を使用できます。Windows エクスプローラーで自動的にサイトが開くように FTP へのショートカットを作成するには、以下の手順を実行します。

]FIG]


[38] [CITE@ja[Internet Explorer 10~9 FTP接続設定の新規作成│eoサービスの接続・設定方法|eoユーザーサポート]]
( ([TIME[2016-04-18 14:08:53 +09:00]]))
<http://support.eonet.jp/setup/homepage/ftp/win/ie10/>

[48] [CITE@en[Issue 333943 - chromium - Remove built-in support for FTP from Chrome - Monorail]]
( ([TIME[2016-06-11 12:50:39 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=333943>

[FIG(quote)[
[FIGCAPTION[
[49] [CITE[Can't access ftp site - Google Product Forums]]
( ([TIME[2016-06-11 12:52:50 +09:00]]))
<https://productforums.google.com/forum/?hl=en#!category-topic/chrome/report-a-problem-and-get-troubleshooting-help/J4SJq1OSzQk>
]FIGCAPTION]

> 
> 11/10/10
> Current row
> esotericmind said:
> I have worked out why this stopped working and found a resolution for my specific setup. The issue seems to be that the latest version of Chrome is using "Extended Passive Mode" (EPSV) for the FTP transfer mode. Internet Explorer still uses standard passive mode (PSV). 
> My FTP server is sat behind a firewall and only had port 21 forwarded to the FTP server. This works fine for PSV mode. However, EPSV mode uses port 21 for the control connection and a random port number for the data transfer. The port number range that Filezilla was using was somewhere between 2400 and 2600. So i added another port forward (in additon to port 21) to map port numbers 2000-3000 to the FTP server and it all works with Chrome again now. I think Filezilla allows you to specify some custom port numbers to make it easier to handle this situation with NAT and port forwarding. 
> Hope this helps the rest of you guys out!
> +1
> 

]FIG]


[FIG(quote)[
[FIGCAPTION[
[50] [CITE[ftpとnat - masami Wiki*]]
( ([TIME[2016-06-11 12:55:08 +09:00]]))
<http://wikiwiki.jp/masami/?ftp%A4%C8nat>
]FIGCAPTION]

> FTPにはパッシブモードと言うのがあってIEもFireFoxもパッシブモードを使用していた。が、その中でもEPSVコマンドがFireFoxには無かった。

]FIG]

[FIG(quote)[
[FIGCAPTION[
[52] [CITE@en-gb[425 Can't open data connection-mozila firefox - FileZilla Forums]]
( ([TIME[2016-06-11 13:00:02 +09:00]]))
<https://forum.filezilla-project.org/viewtopic.php?t=22413>
]FIGCAPTION]

>  Some browsers like Firefox use Passive (PASV) mode, AFAIK Opera even uses Extended Passive (EPSV). IE has a setting for Active (PORT) vs. Passive mode, with old versions defaulting to Active and recent to Passive. A real mess.

]FIG]


[53] [CITE@en[Issue 131847 - chromium - Opening ftp://downloads01.f5.com/README fails - Monorail]]
( ([TIME[2016-06-11 13:04:13 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=131847>

[54] [CITE[Issue 11418035: FTP: Only issue EPSV command for non-IPv4 connections. - Code Review]]
( ([TIME[2016-06-11 13:04:23 +09:00]]))
<https://codereview.chromium.org/11418035/>

[55] [CITE@en[Issue 35050 - chromium - Implement the FTP Extensions for IPv6 specified in RFC 2428. - Monorail]]
( ([TIME[2016-06-11 13:05:59 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=35050>

[56] [CITE@en[Issue 3073 - chromium - Support active FTP - Monorail]]
( ([TIME[2016-06-11 13:08:05 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=3073>

[57] [CITE[Are we going to support active FTP? - Google グループ]]
( ([TIME[2016-06-11 13:09:45 +09:00]]))
<https://groups.google.com/forum/#!topic/chromium-dev/c81LTZvJ4NE>

[58] [CITE@en[Issue 96401 - chromium - FTP file download problem - Monorail]]
( ([TIME[2016-06-11 16:58:29 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=96401>

[59] [CITE@en[61290 – FTP should try RETR before CWD]]
( ([TIME[2016-06-11 17:03:37 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=61290>

[62] [CITE@en[26767 – need support RFC2640 (Internationalization of the File Transfer Protocol)]]
( ([TIME[2016-06-12 00:18:35 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=26767>

[63] [CITE@en[427089 – FTP shouldn't send URLs in UTF-8]]
( ([TIME[2016-06-12 00:22:08 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=427089>

[64] [CITE@en[942791 – Non-ASCII file names should be accessible in FTP directory listings regardless of the FEAT/UTF8 support]]
( ([TIME[2016-06-12 00:22:32 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=942791>

[65] [CITE@en['''['''chrome''']''' Contents of /trunk/src/net/ftp/ftp_network_transaction.cc]]
( ([TIME[2016-06-12 00:33:57 +09:00]]))
<https://src.chromium.org/viewvc/chrome/trunk/src/net/ftp/ftp_network_transaction.cc>

[66] [CITE@en[Issue 25023 - chromium - Chrome hangs when trying to enter an ftp site (ftp://ftp.pdcresearch.com.ar/) - Monorail]]
( ([TIME[2016-06-12 00:55:14 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=25023>

[67] [CITE@en[Issue 56734 - chromium - FTP will not connect unless list is enabled for user - Monorail]]
( ([TIME[2016-06-12 01:20:48 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=56734>

[68] [CITE@en[Issue 21127 - chromium - REGRESSION: '''['''ftp://ftp.ets.org/pub/demo''']''': FTP downloads are broken - Monorail]]
( ([TIME[2016-06-12 01:25:26 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=21127>

[69] [CITE@en[Issue 22193 - chromium - Support VMS FTP servers - Monorail]]
( ([TIME[2016-06-12 01:31:35 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=22193>

[70] [CITE[Working on Chromium's FTP code, testing with VMS FTP servers - Google グループ]]
( ([TIME[2016-06-12 01:32:55 +09:00]]))
<https://groups.google.com/forum/#!msg/comp.os.vms/Bv2NtyZo7Ao/O884Ucg2DaQJ>

[71] [CITE@en[Issue 164724 - chromium - '''['''ftp://180.247.56.11/DATA1/DATA/''']''' issues with file names containing newlines - Monorail]]
( ([TIME[2016-06-12 01:39:58 +09:00]]))
<https://bugs.chromium.org/p/chromium/issues/detail?id=164724>

[72] [CITE@en[gecko-dev/netwerk/protocol/ftp at master · mozilla/gecko-dev]]
( ([TIME[2016-06-12 17:16:10 +09:00]]))
<https://github.com/mozilla/gecko-dev/tree/master/netwerk/protocol/ftp>

[73] [CITE@en[191220 – FTP: not entering directory, instead message box : "Alert: 250 CWD command successful"]]
( ([TIME[2016-06-12 17:19:52 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=191220>

[74] [CITE@en[370559 – (CVE-2007-1562) security problem handling responses to FTP PASV command]]
( ([TIME[2016-06-12 17:42:00 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=370559>

[76] [CITE@en[Block ftp URL requests from non-FTP clients]]
([[mikewest]]著, [TIME[2017-02-17 18:40:46 +09:00]])
<https://github.com/whatwg/fetch/commit/d4114a3b0926fda64a7708d4ec56c6d007b5d133>

[77] [CITE@en[net/data/ftp - chromium/src - Git at Google]]
( ([TIME[2017-03-28 01:10:56 +09:00]]))
<https://chromium.googlesource.com/chromium/src/+/master/net/data/ftp/>

[78] [CITE[PSA: `ftp://` resources will be marked "Not Secure" - Google グループ]]
([TIME[2017-09-20 17:09:54 +09:00]])
<https://groups.google.com/a/chromium.org/forum/#!msg/security-dev/HknIAQwMoWo/xYyezYV5AAAJ>

[79] [CITE@en[1574475 - Remove FTP support]]
([TIME[2020-03-21 08:59:20 +09:00]])
<https://bugzilla.mozilla.org/show_bug.cgi?id=1574475>


[80] 
[[Google検索]]には今でもちゃんと [[FTP]] が出てくることがある。
[TIME[2023-07-29T05:02:26.100Z]]





[81] [CITE[Index of /]], [TIME[2025-04-10T15:18:21.000Z]], [TIME[2025-06-24T13:59:06.942Z]] <https://ftp.sunet.se/>


[82] かつてはソフトウェアの配布やちょっとしたファイルの配布も HTTP ではなく FTP だったのが、今はほぼほぼ絶滅しているのは痛いですね。 [[Web]] は [[Internet Archive]] があるのでまだ救いがありますが、 [[FTP]] でやり取りされたほとんどのデータは散逸してしまって残っているのかどうかもわからない (おそらく残っていないものの方が多い) わけで... [TIME[2025-06-25T14:05:35.691Z]]

[83] 平成初期くらいまで遡ると紹介だけは [[Web]] ([[HTTP]]) でやっててもメインのファイル配布は [CODE[ftp:]] だったりするから残念な思いをすることが多いのよね [TIME[2025-06-25T14:06:23.705Z]]