Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading a directory using JSP/JSF

 
rajshkhr pandey
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to all,

I want to upload a directory to the server using jsp/jsf component. So, how can I browse to the directory?

Thanks in advance.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The contents of the directory or the directory alone ?
 
rajshkhr pandey
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:The contents of the directory or the directory alone ?


I want to upload the content of the directory with directory.
Suppose there are 20 files in the directory, I want to upload the those 20 file.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uploading the directory isn't the problem. Selecting all the files in the directory is. I'm using a RichFaces JSF control to do multi-file uploads, but the user has to select each file individually.

Manual file selection is mandated because making it too automatic would permit people to design malware that bulk-uploaded files with sensitive information in them. The only way I can think of to get around this would be to initiate the uploaded from JavaScript, but JavaScript's sandbox may not permit selection without user interaction for the reason I just gave.

Actually, there's one way that definitely would work, and that's to run a true client-side application such as a Java applet. But in order to make the applet capable of uploading, you'd have to digitally sign it, since unsigned applets aren't allowed to access the user's local filesystem. And getting signed applets accepted by the user's browser is more pain than casual Internet users are generally willing to put up with.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic