This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

Need help in looping

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,


Below is my code for putting multiple file to the sever.

But it overwrite the name and the content of the files with last one.

Please tell me where i am wrong

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
You define your variable "theFile" outside the loop where you assign a value to it, so it will overwrite each time the loop loops.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
This question was already answered multiple times in your original posting.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49442
62
  • Mark post as helpful
  • send pies
  • Report post to moderator
David Newton wrote:This question was already answered multiple times in your original posting.
I looked for a duplicate posting earlier, but missed it. Thank you David for pointing this out: closing thread.
 
    Bookmark Topic Watch Topic
  • New Topic