This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes multiple file upload in Strut2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "multiple file upload in Strut2" Watch "multiple file upload in Strut2" New topic
Author

multiple file upload in Strut2

pankaj semwal
Ranch Hand

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

Joined: Oct 29, 2001
Posts: 8843
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Your code is difficult to read.

That aside, examine line 102.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Oh, and lines 86-92 are almost certainly incorrect.
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi ,

Can you tell me what will be the correct syntax.

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 07, 2008
Posts: 300
Thanks , Now its working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple file upload in Strut2
 
Similar Threads
File upload problem in model driven Action.
Need help in looping
Struts2: file upload not working
Downlaod in Strut2
Struts 2 Fileupload problem