aspose file tools*
The moose likes Java in General and the fly likes Need help in looping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Need help in looping

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 301
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

Joined: Apr 14, 2004
Posts: 10336

You define your variable "theFile" outside the loop where you assign a value to it, so it will overwrite each time the loop loops.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This question was already answered multiple times in your original posting.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39755
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help in looping