From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/api/file/name/index.html | 118 ++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 files/ru/web/api/file/name/index.html (limited to 'files/ru/web/api/file/name') diff --git a/files/ru/web/api/file/name/index.html b/files/ru/web/api/file/name/index.html new file mode 100644 index 0000000000..5dfb9aefee --- /dev/null +++ b/files/ru/web/api/file/name/index.html @@ -0,0 +1,118 @@ +--- +title: File.name +slug: Web/API/File/name +tags: + - API + - File API + - Files + - Property + - Reference +translation_of: Web/API/File/name +--- +

{{APIRef("File API")}}

+ +

Возвращает имя файла представленного объектом типа {{domxref("File")}}. По соображениям безопасности не содержит пути к файлу.

+ +

Синтаксис

+ +
var name = file.name;
+ +

Значение

+ +

Строка, содержащая имя файла без пути, например, "My Resume.rtf".

+ +

Пример

+ +
<input type="file" multiple onchange="processSelectedFiles(this)">
+
+ +
function processSelectedFiles(fileInput) {
+  var files = fileInput.files;
+
+  for (var i = 0; i < files.length; i++) {
+    alert("Filename " + files[i].name);
+  }
+}
+ +

Проверьте результаты ниже:

+ +

{{ EmbedLiveSample('Example', 300, 50) }}

+ +

Спецификация

+ + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('File API', '#file-attrs', 'name')}}{{Spec2('File API')}}Initial definition.
+ +

Совместимость с браузерами

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
File.name13.0{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9.2")}}10.016.0{{CompatVersionUnknown}} [1]
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
File.name{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

[1] {{webkitbug("32912")}}

+ +

Смотри также

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