简体   繁体   中英

How can I open a folder on server by clicking on a link

I have some docs which are located on a shared folder on the server. I need to open up this folder to show these docs by clicking on a link. I tried using <a href="..."> but that didn't work. I don't want to point to any specific file on the folder. If it's the case then it works, but what I want to do is to just open this shared folder by clicking on a link specifying the path.

The technologies which I can use are html, jsp, javascript, jquery.

Please advise how to do this.

Use the Java API to get the files of the folder and display each file as a link on the page.

 File directory = new File("path of shared directory");
 File[] files = directory.listFiles();

Display the files on the page as link, so this will be same as you do currently but it will get all the files in that directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM