• Post Reply Bookmark Topic Watch Topic
  • New Topic

Iterating over multiple file uploads  RSS feed

 
jason thompson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get the keySet from an Iterator? I am trying to implement multiple file uploads using apache commons fileupload. I need to get the filenames from all of the files selected and pass them all to add as attachments.


The below works for one attachment at a time:


But of course, I want to be able to iterate over every file selected to add as attachments.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is actually a question on iterators rather than anything specific to file uploads or servlets, so I have moved this to the general Java forum with an appropriate change of subject.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jason thompson wrote:

entries.next() returns a Map.Entry<String, FileItem>. If you use a local variable for that, you can retrieve both its key and its value quite easily..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!