From 4e6ac017cdd1096518ad80347b6171cfd0cbd5de Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Mon, 27 Dec 2021 21:32:30 +0900 Subject: Web/API/File 以下を変換準備 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/file/index.html | 97 ---------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 files/ja/web/api/file/index.html (limited to 'files/ja/web/api/file/index.html') diff --git a/files/ja/web/api/file/index.html b/files/ja/web/api/file/index.html deleted file mode 100644 index d9fd663e3a..0000000000 --- a/files/ja/web/api/file/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: File -slug: Web/API/File -tags: - - API - - File API - - Interface - - Reference - - Web -translation_of: Web/API/File ---- -
{{APIRef}}
- -

File インターフェイスは、ファイルについての情報を提供したり、ウェブページ内の JavaScript からその内容にアクセスできるようにしたりします。

- -

File オブジェクトは通常、 {{HTMLElement("input")}} 要素を使用してファイルを選択した結果として返される {{DOMxRef("FileList")}} オブジェクト、ドラッグ&ドロップ操作の {{DOMxRef("DataTransfer")}} オブジェクト、または {{DOMxRef("HTMLCanvasElement")}} 上の mozGetAsFile() API から取得します。

- -

File オブジェクトは特別な種類の {{domxref("Blob")}} オブジェクトであり、 Blob が利用できる場面ではどこでも利用できます。特に、{{DOMxRef("FileReader")}}、{{DOMxRef("URL.createObjectURL()")}}、{{DOMxRef("ImageBitmapFactories.createImageBitmap()", "createImageBitmap()")}}、{{DOMxRef("XMLHttpRequest", "", "send()")}} は、BlobFile の両方を受け付けます。

- -

詳しい情報や例は、ウェブアプリケーションからのファイルの使用 を参照してください。

- -

{{InheritanceDiagram}}

- -

コンストラクター

- -
-
{{DOMxRef("File.File", "File()")}}
-
新しく構築された File オブジェクトを返します。
-
- -

インスタンスプロパティ

- -
-
{{DOMxRef("File.prototype.lastModified")}} {{ReadOnlyInline}}
-
ファイルの最終更新時刻を、 UNIX 元期 (1970年1月1日深夜) からの経過ミリ秒数で返します。
-
{{DOMxRef("File.prototype.lastModifiedDate")}} {{Deprecated_Inline}} {{ReadOnlyInline}}
-
File オブジェクトが参照しているファイルの最終更新時刻の {{JSxRef("Date")}} を返します。
-
{{DOMxRef("File.prototype.name")}}{{ReadOnlyInline}}
-
File オブジェクトが参照しているファイルの名前を返します。
-
{{DOMxRef("File.prototype.webkitRelativePath")}} {{Non-standard_Inline}} {{ReadOnlyInline}}
-
{{DOMxRef("File")}} の URL の相対パスを返します。
-
- -

File は {{DOMxRef("Blob")}} を実装しているので、以下のようなプロパティも利用できます。

- -
-
{{DOMxRef("File.prototype.size")}} {{ReadOnlyInline}}
-
ファイルのサイズをバイト単位で返します。
-
{{DOMxRef("File.prototype.type")}} {{ReadOnlyInline}}
-
ファイルの MIME タイプを返します。
-
- -

インスタンスメソッド

- -

File インターフェイスはメソッドを定義せず、{{DOMxRef("Blob")}} インターフェイスからメソッドを継承しています。

- -
-
{{DOMxRef("Blob.prototype.slice()", "Blob.prototype.slice([start[, end[, contentType]]])")}}
-
ソース Blob の指定したバイト数の範囲のデータを含む新しい Blob オブジェクトを返します。
-
{{DOMxRef("Blob.prototype.stream()")}}
-
File を {{DOMxRef("ReadableStream")}} に変換し、File の内容を読み込めるようにします。
-
{{DOMxRef("Blob.prototype.text()")}}
-
File をストリームに変換し、最後まで読み込みます。これは、{{DOMxRef("USVString")}} (テキスト) で解決するプロミスを返します。
-
{{DOMxRef("Blob.prototype.arrayBuffer()")}}
-
File をストリームに変換し、最後まで読み込みます。 {{DOMxRef("ArrayBuffer")}} で解決するプロミスを返します。
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('File API')}}{{Spec2('File API')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.File")}}

- -

関連情報

- - -- cgit v1.2.3-54-g00ecf