GeeCON Prague 2014*
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


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: 301
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: 8915
    
    8

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: 301
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: 301
Thanks , Now its working.
 
GeeCON Prague 2014
 
subject: multiple file upload in Strut2