Browsing file system to select directory in JSF

谁都会走 提交于 2019-12-07 18:46:24

问题


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 .

Any help will be appreciated


回答1:


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.

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


来源:https://stackoverflow.com/questions/13881943/browsing-file-system-to-select-directory-in-jsf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!