user1172963
user1172963

Reputation: 71

How to upload multiple files in Struts 1

How do I upload multiple files in Struts 1's ActionForm? I have to show multiple options of file uploading and save them at time. I don't want to show input box for file in Struts 1?

Upvotes: 7

Views: 3872

Answers (2)

Buhake Sindi
Buhake Sindi

Reputation: 89169

In Struts if you want multiple of anything, you need to create an array of the type you want.

In file upload, you need to have an array of FormFile and multiple input text boxes with the name to the same Struts ActionForm FormFile attribute.

Upvotes: 3

Naved
Naved

Reputation: 4128

You can either use JQuery File Upload which can be easily embed with JSP and can be used with FormFile object of struts.
Or You can define an array of FormFile objects in the ActionForm class.
But for that you have to show multiple input boxes for files.

Upvotes: 1

Related Questions