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 badges1 Answer
Reset to default 11For 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
本文标签:
版权声明:本文标题:javascript - How do you get the selected directory path from file system access api window.showDirectoryPicker() - Stack Overflo 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741027288a2326656.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论