How to upload multiple files in Struts 1
Asked Answered
L

2

7

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?

Lundin answered 27/1, 2012 at 7:13 Comment(0)
I
3

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.

Inna answered 27/1, 2012 at 7:25 Comment(0)
M
1

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.

Manstopper answered 27/1, 2012 at 7:23 Comment(1)
i have created multiple array of FormFile but it give me error on jsp while submiting formLundin

© 2022 - 2024 — McMap. All rights reserved.