From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/hu/web/api/file/index.html | 226 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 files/hu/web/api/file/index.html (limited to 'files/hu/web/api/file/index.html') diff --git a/files/hu/web/api/file/index.html b/files/hu/web/api/file/index.html new file mode 100644 index 0000000000..ce77a8fc63 --- /dev/null +++ b/files/hu/web/api/file/index.html @@ -0,0 +1,226 @@ +--- +title: File +slug: Web/API/File +translation_of: Web/API/File +--- +
{{APIRef}}
+ +

ONGOING The File interface provides information about files and allows JavaScript in a web page to access their content.

+ +

File objects are generally retrieved from a {{domxref("FileList")}} object returned as a result of a user selecting files using the {{HTMLElement("input")}} element, from a drag and drop operation's {{domxref("DataTransfer")}} object, or from the mozGetAsFile() API on an {{domxref("HTMLCanvasElement")}}. In Gecko, privileged code can create File objects representing any local file without user interaction (see {{anch("Implementation notes")}} for more information.)

+ +

A File object is a specific kind of a {{domxref("Blob")}}, and can be used in any context that a Blob can. In particular, {{domxref("FileReader")}}, {{domxref("URL.createObjectURL()")}}, {{domxref("ImageBitmapFactories.createImageBitmap()", "createImageBitmap()")}}, and {{domxref("XMLHttpRequest", "", "send()")}} accept both Blobs and Files.

+ +

See Using files from web applications for more information and examples.

+ +

{{InheritanceDiagram}}

+ +

Constructor

+ +
+
{{domxref("File.File", "File()")}}
+
Returns a newly constructed File.
+
+ +

Properties

+ +
+
{{domxref("File.lastModified")}} {{readonlyinline}}
+
Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
+
{{domxref("File.lastModifiedDate")}} {{readonlyinline}} {{deprecated_inline}} {{gecko_minversion_inline("15.0")}}
+
Returns the last modified Date of the file referenced by the File object.
+
{{domxref("File.name")}} {{readonlyinline}}
+
Returns the name of the file referenced by the File object.
+
{{domxref("File.webkitRelativePath")}} {{readonlyinline}} {{non-standard_inline}}
+
Returns the path the URL of the {{domxref("File")}} is relative to.
+
+ +

File implements {{domxref("Blob")}}, so it also has the following properties available to it:

+ +
+
{{domxref("File.size")}} {{readonlyinline}}
+
Returns the size of the file.
+
{{domxref("File.type")}} {{readonlyinline}}
+
Returns the MIME type of the file.
+
+ +

Methods

+ +

The File interface doesn't define any methods, but inherits methods from the {{domxref("Blob")}} interface:

+ +
+
{{domxref("Blob.slice()", "Blob.slice([start[, end[, contentType]]])")}}
+
Returns a new Blob object containing the data in the specified range of bytes of the source Blob.
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('File API')}}{{Spec2('File API')}}Initial definition
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support13{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9")}}[1]
+ {{CompatGeckoDesktop("7")}}
10.011.56.0
name{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9.2")}}11.0{{CompatUnknown}}{{CompatUnknown}}
lastModifiedDate {{deprecated_inline}}{{CompatUnknown}}{{CompatNo}}{{CompatGeckoDesktop("15")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
webkitRelativePath {{non-standard_inline}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("49")}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
size{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}11.0{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9")}}[1]
+ {{CompatGeckoMobile("7")}}
{{CompatNo}}11.16.0
name{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9.2")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
lastModifiedData {{deprecated_inline}}{{CompatUnknown}}{{CompatNo}}{{CompatGeckoMobile("15")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
webkitRelativePath {{non-standard_inline}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("49")}}{{CompatUnknown}}{{CompatVersionUnknown}} +

{{CompatVersionUnknown}}

+
size{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Non-standard implementation.

+ +

Implementation notes

+ + + +

See also

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