admin管理员组

文章数量:1264880

When I choose a folder I do get a dirHandle but cannot figure out what property or method will give me the full path

const dirHandle = await window.showDirectoryPicker()

So something like let path = dirHandle.fullpath

Any ideas?

When I choose a folder I do get a dirHandle but cannot figure out what property or method will give me the full path

const dirHandle = await window.showDirectoryPicker()

So something like let path = dirHandle.fullpath

Any ideas?

Share Improve this question edited Dec 28, 2024 at 9:20 VLAZ 29.1k9 gold badges62 silver badges84 bronze badges asked Sep 18, 2021 at 16:28 dandan 2,9576 gold badges38 silver badges64 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

For security reasons the full path will not be revealed to web applications. You can only learn the relative paths by walking through a directory. In the example below, if the user opens shared/, you can learn about the existence of ./public and ./public/file.txt inside of it, but not that shared/ lies in secret/ and further up.

/root/secret/shared/public/file.txt

本文标签: