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: 49841
70
  • 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