Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple file upload in Strut2

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am uploading multiple files .But it only saving the latest select file in the upload directory of my server .
Please tell me where i am wrong

Below is my code.

JSP PAGe:





Below is my Action class


 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct me if I'm wrong, but it looks like this line:

only gets invoked once. So you are actually saving multiple files but you are saving them all to the same name.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code is difficult to read.

That aside, examine line 102.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, and lines 86-92 are almost certainly incorrect.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Can you tell me what will be the correct syntax.

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The syntax is fine. But consider what's actually being done on those lines, compared to your (probable) intent.

It could be something as simple as having closed a loop too soon, or started a loop too late. In any case, none of it is difficult to fix, although it could be cleaned up some.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , Now its working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic