-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
47 lines (32 loc) · 1.02 KB
/
index.md
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
---
title: "FileSystemHandle: name property"
short-title: name
slug: Web/API/FileSystemHandle/name
page-type: web-api-instance-property
browser-compat: api.FileSystemHandle.name
---
{{securecontext_header}}{{APIRef("File System API")}}{{AvailableInWorkers}}
The **`name`** read-only property of the
{{domxref("FileSystemHandle")}} interface returns the name of the entry represented by
handle.
## Value
A string.
## Examples
The following function allows the user to choose a file from the file picker and
retrieve the `name` property.
```js
// store a reference to our file handle
let fileHandle;
async function getFile() {
// open file picker
[fileHandle] = await window.showOpenFilePicker();
const fileName = fileHandle.name;
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [File System API](/en-US/docs/Web/API/File_System_API)
- [The File System Access API: simplifying access to local files](https://developer.chrome.com/docs/capabilities/web-apis/file-system-access)