java - How to read files on client local disk from server side code (JSP or Servlet) -


i writing web project java. have problems reading files on client machine's local disk using servlet. when directly run following code in eclipse, runs well. can read files on other client machine (not on server machine). but, when make project war file, put on tomcat server , run it, cannot read files. hints , advice in advance. code here:

file file = new file("\\\\dell-nb\\sharedfile");   file[] list=file.listfiles();   for(int i=0;i<list.length;i++)             system.out.println(list[i].getname()); 

it 'designed', @ best security reasons. imagine server can access files in computer. not have privacy. best way transfert file client server upload. search on net on how make upload page in java.

check this: http://commons.apache.org/proper/commons-fileupload/ , how upload files server using jsp/servlet?


Comments