/
686.txt
96 lines (68 loc) · 4.91 KB
/
686.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[18] [DFN[[RUBYB[[[ダウンロード]]]@en[download]]]]は、
[[クライアント]]が[[サーバー]]から受信する操作をいいます。
多くの場合、[[クライアント]]側の[[ファイルシステム]]等の[[データベース]]に保存する操作までを含めて[[ダウンロード]]といいます。
;; [19] 受信したデータをその場で表示したり、[[ストリーミング]]再生したりする操作も[[ネットワーク]]からのデータ受信のみに着目すれば[[ダウンロード]]ですが、
[[利用者]]が意図的に[[ファイル]]として保存しないため、
[[利用者]]の視点では[[ダウンロード]]ではありません。
* プロトコル
[20] [[HTTP]] や [[FTP]] が[[ファイル]]転送に使われます。
[21] 次のような[[プロトコル要素]]や[[アルゴリズム]]があります。
[FIG(short list)[
- [CODE(DOMa)@en[[[download]]]] [[属性]] ([[HTML]])
- [CODE(HTTP)@en[[[Content-Disposition:]] [[attachment]]]]
- [[証明書ダウンロード]]
- [[navigate]]
]FIG]
* 保存
[13] 多くの [[Webブラウザー]]は、 [[navigate]] 時の[[ダウンロード]]の他に、
表示中の[[文書]]の保存や、[[画像]]、[[媒体]]等の保存の機能を提供しています。
[14] [[文書]]の保存は、元の [[HTML]] の保存だけでなく、表示中の[[文書]]の直列化や、
表示中の[[文書]]とそれに埋め込まれている[[画像]]や [[CSS]] 等の一式の保存、
[[平文]]化して保存といった機能が提供されていることがあります。
[15] 「Web ページ、完全」で保存すると、 [[Chrome]] と [[Firefox]]
の場合は[[拡張子]]以外のファイル名 +
[CODE[_files]]、 [[IE]] の場合は拡張子以外のファイル名 + [CODE[.files]]
という名前の[[フォルダー]]が作られ、その中に[[画像]]等のファイルが保存されます。
;; [16] [[Windows]] の[[エクスプローラー]]は本体ファイルを削除するとこの[[フォルダー]]も同時に削除します。
[17] [[IE]] は [[MHT]] 形式での保存にも対応しています。この形式では[[画像]]等もまとめて1つのファイルになります。
* 歴史
[1] [CITE@en[HTML5 Tracker]]
([TIME[2011-07-22 16:15:06 +09:00]] 版)
<http://html5.org/tools/web-apps-tracker?from=6317&to=6318>
[2] [CITE[''''''[''''''whatwg'''''']'''''' Forcing a download]]
( ([TIME[2011-07-22 23:58:54 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-July/032601.html>
[3] [CITE[''''''[''''''whatwg'''''']'''''' <a download> feedback]]
( ([TIME[2012-02-16 08:22:31 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-February/034880.html>
[4] [CITE['''['''whatwg''']''' <a download> feedback]]
([TIME[2012-06-08 11:28:51 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-June/036320.html>
[5] [CITE[WWW-Talk Jan-Mar 1993: binary file access via Mosaic]]
( ([TIME[2013-03-09 04:06:44 +09:00]] 版))
<http://1997.webhistory.org/www.lists/www-talk.1993q1/0258.html>
[6] [CITE@en[676619 – Implement proposed download attribute]]
( ([TIME[2013-03-18 08:55:15 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=676619>
[7] [CITE@en[Web Applications 1.0 r7836 Fix <area> to match <a> in terms of security checking. Also, some editorial fixes.]]
( ([TIME[2013-04-16 04:11:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7835&to=7836>
[8] [CITE[''''''[''''''whatwg'''''']'''''' Priority between <a download> and content-disposition]]
( ([TIME[2013-08-13 21:25:48 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-August/040445.html>
[9] [CITE[Add download context per https://www.w3.org/Bugs/Public/show_bug.cgi?id=... · 69dfdc3 · whatwg/fetch]]
( ([TIME[2014-05-20 09:03:48 +09:00]] 版))
<https://github.com/whatwg/fetch/commit/69dfdc385ff40d48c06fede66b28a6aedbc848b0>
[FIG(quote)[
[FIGCAPTION[
[10] [CITE@en[1030660 – Is ClearBogusContentEncodingIfNeeded() needed?]]
([TIME[2015-03-06 13:52:40 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=1030660>
]FIGCAPTION]
> Note that specifically for the save-to-file behavior what we actually do is completely ignore the Content-Type when deciding whether to decode. We just compare the URI filename extension, if any, to the Content-Encoding. If the Content-Encoding matches the filename extension, we don't undo the content encoding; otherwise we undo it.
]FIG]
[11] [CITE@en[184971 – display MIME type of the server in download dialog and not the mime-type returned by windows registry]]
([TIME[2015-04-11 22:35:21 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=184971>
* 実装
[12] 最近の [[Webブラウザー]]には、[[ダウンロード]]したファイルのセキュリティー検査を自動的に行うものもあります。