I have a list of forms including image files and collect them using jquery and try to send them to the controller, I tried to send one form that included an image, and working fine, but when I send the list, not work
I have a list of forms including image files and collect them using jquery and try to send them to the controller, I tried to send one form that included an image, and working fine, but when I send the list, not work
2
Answers
Yes, you can send a list of objects including images using the
FormData
object from view to thecontroller
by anAJAX
call.To do this, you can create a new instance of the
FormData
object, append each form in the list to theFormData
object, and then send theFormData
object through anAJAX
call to thecontroller
.Here is an example that demonstrates how to do it:
You can make it as the following example: