#?SuikaWiki/0.9 [8] [DFN[[[媒体型]] [CODE(MIME)[application/octet-stream]]]] は、''任意のバイナリ(二進)・データ''を表します。 すなわち、 [CODE(MIME)[application/octet-stream]] と札付けされた[[実体]]の[[本体]]は何らかの意味を持つ (あるいは持たない) 任意のビット列です。 「[[オクテット列]]」という名前に反して、 実は任意の[[ビット列]]を扱えます。 [WEAK[(8ビット単位になっている必要はありません。)]] [WEAK[(ただし実装されたり使用されたりしているのを見たことはありません。)]] [9] [[MIME]] の媒体型の仕組みの中では、この媒体型はやや特殊な位置付けです。 [CODE(MIME)[[[text/[VAR[*]]]]]] や [CODE(MIME)[[[multipart/[VAR[*]]]]]] 以外の媒体型は、 もし実装がその具体的な媒体型を知らなければ、 [CODE(MIME)[application/octet-stream]] と同じように扱います。 [WEAK[たとえば、 [SAMP(MIME)[application/x-foobar]] という媒体型を知らない MIME [ABBR[[[UA]]]] は、 [CODE(MIME)[aplication/x-foobar]] の実体を [CODE(MIME)[application/x-foobar]] の実体と同じように処理します。]] また、実装が知っている媒体型であっても、知らない [ABBR[[[CTE]]]] で転送符号化されているときには、やはり [CODE(MIME)[application/octet-stream]] として扱うことになっています。 つまり、 [CODE(MIME)[application/octet-stream]] は最も基本的な媒体型と言うことができます。 [10] MIME [ABBR[UA]] が [CODE(MIME)[application/octet-stream]] の実体を受取った時に、これをどう処理するかは、 他のほとんどの媒体型同様に、実装依存です。 しかしながら、未知のバイナリ・データなのですから、 直接表示しないで[[利用者]]の指示を仰ぐか、 [[バイナリ・エディタ]]の類のように十六進数などで表示するのが望ましいでしょう。 実際ほとんどの実装はそのように扱います。 [[#comment]] *type パラメーター 値: - 2002-09-14 (Sat) 16:08:24 ''[[名無しさん]]'' : "emacs-lisp" [[elisp]] script (program?) - 2002-09-15 (Sun) 14:51:04 ''[[名無しさん]]'' : "patch" [[patch]] file - 2002-09-16 (Mon) 20:55:53 ''[[名無しさん]]'' : "gzip" [[gzip]]ed data - [1] [WEAK[2003-09-14 15:54:03 +00:00]] ''[[Powerpoint]]'': Application Winme - [2] [WEAK[2003-09-29 02:20:45 +00:00]] ''[[名無しさん]]'': octet-streamとは - [3] >>2 octet‐stream とは、読んで字の如く、オクテットの連続体のことです。 MIME 的には、任意の[[オクテット]]列, すなわち任意のバイナリを意味します。 - [4] また、 octet という名前ではありますが、実は仕様的にはオクテット (= 8ビット) 単位になっていない任意のビット列を扱うこともできます。 (実際に扱える実装があるのかはしらないけど) [[#comment]] *RFC 2046 4.5.1. Octet-Stream Subtype The "octet-stream" subtype is used to indicate that a body contains arbitrary binary data. The set of currently defined parameters is: "octet-stream" 亜型は本文が任意のバイナリ・データであることを 示すのに使います。現在定義されているパラメーターの集合は、 次の通りです。 (1) TYPE -- the general type or category of binary data. This is intended as information for the human recipient rather than for any automatic processing. TYPE バイナリ・データの一般的な型や分類。これは自動処理ではなく 人間受信者向けの情報を意図しています。 (2) PADDING -- the number of bits of padding that were appended to the bit-stream comprising the actual contents to produce the enclosed 8bit byte-oriented data. This is useful for enclosing a bit-stream in a body when the total number of bits is not a multiple of 8. PADDING 実際の内容のビット列を8ビット・バイト指向のデータに するために付け足した埋めビットの数。これはビットの合計数が8の倍数 でないビット列を本文に包むのに便利です。 訳注: RFC 1521 によると取りうる値は "0" 〜 "7" です。 [[application/*媒体型]]参照。 RFC 2046 にこの規定はありませんが、 常識的に考えてこの範囲でしょう。 (これより大きな値を受け取った時は どうしましょうか?) Both of these parameters are optional. 両パラメーターとも省略可能です。 An additional parameter, "CONVERSIONS", was defined in RFC 1341 but has since been removed. RFC 1341 also defined the use of a "NAME" parameter which gave a suggested file name to be used if the data were to be written to a file. This has been deprecated in anticipation of a separate Content-Disposition header field, to be defined in a subsequent RFC. 追加のパラメーター "CONVERSIONS" が RFC 1341 で定義されていましたが 削除されました。 RFC 1341 はデータをファイルに書くときに 使われるファイル名を提案する "NAME" パラメーターの使用も 定義していました。これは後の RFC で定義される別の Content-Disposition 頭領域を使うことを期待するものです。 ;; 意訳。 The recommended action for an implementation that receives an "application/octet-stream" entity is to simply offer to put the data in a file, with any Content-Transfer-Encoding undone, or perhaps to use it as input to a user-specified process. "application/octet-stream" 実体を受け取った実装の推奨される動作は、 Content-Transfer-Encoding を戻して、単にデータをファイルに入れるか または利用者の指定する処理の入力として使うかです。 To reduce the danger of transmitting rogue programs, it is strongly recommended that implementations NOT implement a path-search mechanism whereby an arbitrary program named in the Content-Type parameter (e.g., an "interpreter=" parameter) is found and executed using the message body as input. 浮浪プログラムの転送の危険を減らすため、実装は Content-Type パラメーター (例えば "interpreter=" パラメーター) で指名された任意のプログラム があればメッセージ本文を入力に使って実行する経路検索機構を 実装'''しない'''ことを強く推奨します。 *RFC 1341 7.4.1 から抜粋 ・・・ NAME -- a suggested name for the binary data if stored as a file. NAME バイナリ・データがファイルとして保管される時の名前の提案。 ・・・ CONVERSIONS -- the set of operations that have been performed on the data before putting it in the mail (and before any Content-Transfer-Encoding that might have been applied). If multiple conversions have occurred, they must be separated by commas and specified in the order they were applied -- that is, the leftmost conversion must have occurred first, and conversions are undone from right to left. Note that NO conversion values are defined by this document. Any conversion values that that do not begin with "X-" must be preceded by a published specification and by registration with IANA, as described in Appendix F. CONVERSIONS データをメイルに入れる前 (で Content-Transfer-Encoding が適応されたかもしれない前) に施された処理の集合 複数の変換があった場合は、 読点(comma)で区切って施された順に指定します。つまり左端の変換が 最初に行われたもので無くてはならず、逆変換は右から左へと戻していきます。 この文書では変換値は定義'''しません'''。 "X-" で始まらない変換値 は予め仕様書を出版して IANA に附属書 F で説明する通り登録する 必要があります。 ・・・ The values for these attributes are left undefined at present, but may require specification in the future. An example of a common (though UNIX-specific) usage might be: これらの属性の値は現時点で未定義のままですが、将来規定する必要がある かもしれません。共通な (UNIX 特有だけど) 例は、次の通りです。 Content-Type: application/octet-stream; name=foo.tar.Z; type=tar; conversions="x-encrypt,x-compress" However, it should be noted that the use of such conversions is explicitly discouraged due to a lack of portability and standardization. The use of uuencode is particularly discouraged, in favor of the Content-Transfer-Encoding mechanism, which is both more standardized and more portable across mail boundaries. ですが、このような変換の使用は移植性と標準化を欠いているので、 明白に非推奨であることに注意して下さい。 uuencode の使用は特に非推奨です。 より標準化されているしよりメイル境界を越えて移植性がある Content-Transfer-Encoding 機構があります。 ・・・ *See also -[[MIME]] --[[媒体型]] ---[[application/*媒体型]] ---[[Content-Type:領域]] --[[Content-Transfer-Encoding:領域]] --[[Content-Disposition:領域]] --RFC 1341 --RFC 1521 --RFC 2045 --RFC 2046 --RFC 2048 *License See [[RFCのライセンス]] - [5] ''cbfext98 v0.7.1'' : 圧縮方式を表すのに [CODE(MIME)[conversions]] 引数を使っています。値は [CODE(MIME)[x-CBF_CANONICAL]] と [CODE(MIME)[x-CBF_PACKED]]。 - [6] ''Bommanews technical'' : 内部的な保管形式ですが、 [CODE(MIME)[name]] 引数の意味で [CODE(MIME)[file]] 引数を使っています。 - [7] [Q[ファイルをダウンロードさせたいときは [CODE(MIME)[application/octet-stream]] を使えばいい]]と言うのはいろいろな意味で間違いであり、気持ち悪い。 (1) ダウンロード ≠ 保存。 (2) [CODE(MIME)[application/octet-stream]] は保存と言う意味でもダウンロードという意味でもない。 [CODE(MIME)[[[Content-Type]]]] 欄などはあくまで[[実体本体]]の[[媒体型]]を記述するべきであって、受信者の動作を記述するべきではない。 [WEAK[(MIME や HTTP では他に内容の記述形式を表す方法がないと言うのに、動作の表現に使ってどうするのさ。)]] [WEAK[(受信者の動作の指針を与えるためには [CODE(MIME)[[[Content-Disposition]]]] を使うのが正しい。)]] [11] [[W3C]] のサイトの [[tar]]+[[gz]] な資源、 なぜか [CODE(MIME)[application/octet-stream]] になってます。ブラウザで展開ソフトウェアに関連付けることができないので不便。なんとかしてほしいなあ。