浏览文件系统以选择JSF中的目录 [英] Browsing file system to select directory in JSF
问题描述
有没有一种方法可以在facelets中实现浏览文件系统目录 我不希望用户键入目录 我在primefaces展示柜中搜索了它,但没有找到它.
is there a way to implement browsing file system directory in facelets i don't want the user to type the directory i search it in primefaces showcases but i didn't find it .
任何帮助将不胜感激
推荐答案
出于安全原因,您无法使用HTML/JavaScript浏览文件系统.如果您想做这样的事情,可以使用Java applet或Flash元素,但我发现这样的事情令人反感.
For security reasons you cannot browse the filesystem with HTML/JavaScript. If you want to do such a thing you could use a Java applet or a Flash element, but I found such things repulsive.
您不清楚要执行此操作的原因.如果用于下载文件并选择目标位置,则应该使用常规文件下载.
The reason you want to do this is unclear to me. If it's for downloading a file and selecting a destination, you should be using a regular file download.
您可能需要做更多的研究.我在SO上发现了几个可比的问题:
You might want to do more research. I found a couple questions on SO that are comparable:
- Directory Chooser in HTML page
- File picker with ability to select folder to be used on a webpage
- How can I let the user select a folder from an HTML page so that all the files can be uploaded
这篇关于浏览文件系统以选择JSF中的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!